public async Task HandleAsync(SendSmsCommand command, CancellationToken cancellationToken = default(CancellationToken)) { var conversation = command.Message.Conversation.ToConversation(); var mobileNumber = command.Message.From.UserId; // TODO: [security] read mobile number from userId hash var templateId = _settingService.Get("NotifyTemplateId"); var personalization = new Dictionary <string, dynamic> { { "message", command.Message.Message } }; var reference = command.Message.Conversation.ConversationId; var smsSenderId = _settingService.Get("NotifySmsSenderId"); await _notificationClient.SendSms( mobileNumber, templateId, personalization, reference, smsSenderId); await _conversationRepository.Save(conversation); }
public async Task SendSms(string domain, string mobileNumber, string templateId, string sessionId) { var personalisation = GetPersonalisation(domain, sessionId); var response = NotificationClient.SendSms(mobileNumber, templateId, personalisation); await Task.CompletedTask; }