public LoggingPageViewModel(ILogView logView, IClipboard <ILogView> clipboard, IMailClient <ILogView> mailClient) { LogView = logView; SendCommand = new DelegateCommand(() => mailClient.SendAsync(LogView)); CopyCommand = new DelegateCommand(() => clipboard.Copy(LogView)); }
public Task SendMail(EmailBase email) { IMailClient mailClient = _emailFactory.CreateMailClient(); IEmailBuilder emailBuilder = _emailFactory.CreateEmailBuilder(); _emailInitializer.Initialize(emailBuilder, email); return(mailClient.SendAsync(emailBuilder)); }
public Task SendMails(IEnumerable <EmailBase> mailList) { return(Task.WhenAll(mailList.Select(email => { IMailClient mailClient = _emailFactory.CreateMailClient(); IEmailBuilder emailBuilder = _emailFactory.CreateEmailBuilder(); _emailInitializer.Initialize(emailBuilder, email); return mailClient.SendAsync(emailBuilder); }))); }
public async Task Handle(PromocodeAddedIntegrationEvent <CompanyMailContent> @event) { _logger.LogInformation("Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.EventId, ApplicationInfo.ApplicationName, @event); var message = new MimeMessage(); message.From.Add(new MailboxAddress("Exadel Info", "*****@*****.**")); message.To.Add(new MailboxAddress("Mr. Friend", "*****@*****.**")); message.Subject = "Exadel Promo"; message.Body = _mailBuilder.GetMessageBody(MailBodyOption.Company, LanguageOption.Ru, @event.Content); await _mailClient.SendAsync(message); await Task.CompletedTask; }