private async Task <CsResult <bool> > SendEmailAsync(string from, string to, Dto.Email email) { var fromAddress = new EmailAddress(SenderEmail); var toAddress = new EmailAddress(to); var msg = MailHelper.CreateSingleEmail(fromAddress, toAddress, email.Subject, string.Empty, email.Content); msg.SetReplyTo(new EmailAddress(from, email.Name)); var response = await Client.SendEmailAsync(msg); if (response.StatusCode == System.Net.HttpStatusCode.Accepted) { return(CsResult.CreateResult(true)); } var content = await response.Body.ReadAsStringAsync(); return(CsResult <bool> .createError(content)); }
public Task <CsResult <bool> > AskForHelpAsync(string from, Dto.Email email) => SendEmailAsync(from, HelpEmail, email);
public Task <CsResult <bool> > SendFeedbackAsync(string from, Dto.Email email) => SendEmailAsync(from, FeedbackEmail, email);