/// <inheritdoc/> public async Task SendAsync(NotificationContentRequestModel notificationContentRequestModel) { var model = notificationContentRequestModel as SmsRequestModel; var queueName = _configurationHelper.SmsQueueName(); var smsDto = new SmsDto { To = model.To, Body = model.Content }; await _serviceBusHelper.SendMessageToQueueAsync(smsDto, queueName); }
/// <inheritdoc/> public async Task SendAsync(NotificationContentRequestModel notificationContentRequestModel) { var model = notificationContentRequestModel as EmailRequestModel; var email = GetEmailModelProperties(model); var queueName = _configurationHelper.EmailQueueName(); var emailDto = new EmailDto { EmailData = JObject.FromObject(email), FromEmail = notificationContentRequestModel.From, ToEmail = string.IsNullOrEmpty(model.To) ? _configurationHelper.SendGridToEmail() : model.To, Type = model.Type }; await _serviceBusHelper.SendMessageToQueueAsync(emailDto, queueName); }
/// <inheritdoc/> public override IModelValidator Create(NotificationContentRequestModel notificationContentRequestModel) => new EmailRequestModelValidator(notificationContentRequestModel);
/// <summary> /// Create an instance of model validator. /// </summary> /// <param name="notificationType">The notification type.</param> /// <param name="notificationContent">The notification content.</param> /// <returns>Instance of <see cref="IModelValidator"/>.</returns> public IModelValidator ExecuteCreation(NotificationTypeEnum notificationType, NotificationContentRequestModel notificationContent) => _factories[notificationType].Create(notificationContent);
/// <summary> /// Initializes a new instance of the <see cref="EmailRequestModelValidator"/> class. /// </summary> /// <param name="notificationContentRequestModel">Notification content request model.</param> public EmailRequestModelValidator(NotificationContentRequestModel notificationContentRequestModel) { _model = notificationContentRequestModel as EmailRequestModel; }
/// <summary> /// Creates Model validator. /// </summary> /// <param name="notificationContentRequestModel">Notification content request model.</param> /// <returns>Implementation of IModelValidator.</returns> public abstract IModelValidator Create(NotificationContentRequestModel notificationContentRequestModel);
/// <summary> /// Initializes a new instance of the <see cref="SmsRequestModelValidator"/> class. /// </summary> /// <param name="notificationContentRequestModel">Notification content request model.</param> public SmsRequestModelValidator(NotificationContentRequestModel notificationContentRequestModel) { _model = notificationContentRequestModel as SmsRequestModel; }