public Mail Translate(OrderUpdate orderUpdate) { var mail = Mail.GetInstance(); mail.AddTo(orderUpdate.ReminderTo); mail.AddCc(orderUpdate.CopyReminderTo); mail.Subject = string.Format("Task Reminder! Task {0} is due on {1}", orderUpdate.OrderReference, orderUpdate.DueDate); return mail; }
public Task Send(OrderUpdate reminder) { var mail = _translator.Translate(reminder); var credentials = new NetworkCredential( ConfigurationManager.AppSettings["sendGridUserName"], ConfigurationManager.AppSettings["sendGridPassword"] ); var api = Web.GetInstance(credentials); return api.DeliverAsync(mail); }