public void Send(string recipient, string subject, EmailBody body) { Send(new List <string>() { recipient }, subject, body); }
public void SendBookingCreatedEmail(Event dbEvent, Participant dbParticipant) { var subject = string.Format("{0}: Vluchten zijn geboekt!", dbEvent.Title); var salutation = string.Format("Beste {0}", dbParticipant.Name); var announcement = string.Format("Hieronder vind u de definitieve vlucht informatie voor de afspraak '{0}'.", dbEvent.Title); var htmlBuilder = new StringBuilder(); htmlBuilder.AppendLine(salutation); htmlBuilder.AppendLine("<br /><br />"); htmlBuilder.AppendLine(announcement); htmlBuilder.AppendLine("<br /><br />"); var textBuilder = new StringBuilder(); textBuilder.AppendLine(salutation); textBuilder.AppendLine(""); textBuilder.AppendLine(announcement); textBuilder.AppendLine(""); AddFlightInformation(dbEvent, htmlBuilder, textBuilder); var body = new EmailBody() { Html = htmlBuilder.ToString(), Text = textBuilder.ToString() }; Send(dbParticipant.Email, subject, body); }
public void Send(List <String> recipients, string subject, EmailBody body) { var mailer = new SendGridMail(); var msg = mailer.CreateMessage(_from, recipients, subject, body.Html, body.Text); mailer.SendMessage(msg); }