private EmailContent GetEmailContent(EmailModel model) { var emailContent = new EmailContent(); switch (model.EmailType) { case EmailTypes.RegisteredSuccessfully: emailContent.Header = "Registrierung bei EventCorp"; emailContent.Body = "Vielen Dank, dass sich sich für uns entschieden haben"; break; case EmailTypes.Subscribed: break; case EmailTypes.Unsubscribed: break; case EmailTypes.ChangedUserData: break; case EmailTypes.ChangedPassword: break; case EmailTypes.UserRegistered: break; case EmailTypes.EventCreated: break; default: throw new ArgumentOutOfRangeException(); } return emailContent; }
public async Task<IHttpActionResult> SendMail(EmailModel model) { List<MailMessage> result = new List<MailMessage>(); try { var sendTo = await GetMailReceivers(model.SendTo); var messagedata = GetEmailContent(model); } catch (Exception e) { return InternalServerError(new Exception("Error on sending Mail", e)); } return Ok(result); }