public async Task <string> Execute(SendEmailInput input) { await Task.Yield(); Input = input; return("SendEmail"); }
public async Task SendMail() { var attachmentFile = new FileDescription[0]; attachmentFile = attachmentFile.Append(new FileDescription { FileName = "BinhNguyen attachment file name", Data = await File.ReadAllBytesAsync(@"E:\\config_background.txt") }).ToArray(); var sendEmailInput = new SendEmailInput { Content = string.Empty, Subject = string.Empty, RecipientEmails = new string[] { "*****@*****.**" }, AttachmentFiles = attachmentFile }; await _sendMailService.SendMails(sendEmailInput); }
public async Task SendMails(SendEmailInput inputDto) { inputDto.Subject = inputDto.Subject.GetValueOrDefault("[Thư gửi không có tiêu đề]"); var body = inputDto.Content + $"</br><p><i>* Đây là email được gửi thông qua hệ thống, nếu có phản hồi, vui lòng gửi về email: [email protected] </i></p>"; var emailsToSend = inputDto.RecipientEmails.Concat(inputDto.CcEmails.IfNotNull(x => x, new string[0])) .Concat(inputDto.BccEmails.IfNotNull(x => x, new string[0])); foreach (var recipientEmail in emailsToSend) { await SendEmailAsync( "Binh Nguyen", "*****@*****.**", "", recipientEmail, inputDto.Subject, body, null, inputDto.AttachmentFiles); } }
public static bool IsEmailSent(this IServiceProvider source, SendEmailInput input) { return(((FakeEmailSender)source.GetService <IEmailSender>()).IsEmailSent(input)); }
internal bool IsEmailSent(SendEmailInput input) => _store.ContainsKey($"{input.To}:{input.Subject}:{input.TemplateName}");
public ValueTask SendAsync(SendEmailInput input) { _store.TryAdd($"{input.To}:{input.Subject}:{input.TemplateName}", input); return(new ValueTask()); }
public ValueTask SendAsync(SendEmailInput input) { // assume we sending :) Ignore for now return(new ValueTask()); }