Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
 /// <inheritdoc/>
 public override IModelValidator Create(NotificationContentRequestModel notificationContentRequestModel)
 => new EmailRequestModelValidator(notificationContentRequestModel);
Exemplo n.º 4
0
 /// <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);
Exemplo n.º 5
0
 /// <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;
 }
Exemplo n.º 6
0
 /// <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;
 }