示例#1
0
 public void Send(string recipient, string subject, EmailBody body)
 {
     Send(new List <string>()
     {
         recipient
     }, subject, body);
 }
示例#2
0
        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);
        }
示例#3
0
        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);
        }