private async System.Threading.Tasks.Task SendEmailNotification(SubmissionTemplateType notificationType, string email, string name, IEnumerable <KeyValuePair <string, string> > tokens) { var template = (EmailTemplate)await templateProviderResolver.Resolve(NotificationChannelType.Email).Get(notificationType); var emailContent = (await transformator.Transform(new TransformationData { Template = template.Content, Tokens = new Dictionary <string, string>(tokens) })).Content; await notificationSender.Send(new EmailNotification { Subject = template.Subject, Content = emailContent, To = new[] { new EmailAddress { Name = name, Address = email } } }); }
public async Task <Template> Get(SubmissionTemplateType template) => await Task.FromResult(template switch
public async Task <Template> Get(SubmissionTemplateType template) => template switch {