public SendEmailOptions GetSendMailOptions(int userid, TemplateContext templateContext)
 {
     var mailOptions = new SendEmailOptions()
     {
         ToUserId = userid,
         Header = _templateController.RenderTokenString(EmailTarget.Header.ToTemplateTypeString(), templateContext),
         Footer = _templateController.RenderTokenString(EmailTarget.Footer.ToTemplateTypeString(), templateContext),
         Subject = _templateController.RenderTokenString(EmailTarget.Subject.ToTemplateTypeString(), templateContext),
         Body = _templateController.RenderTokenString(EmailTarget.Body.ToTemplateTypeString(), templateContext),
     };
     return mailOptions;
 }
Пример #2
0
 /// <summary>
 /// Send an eMail synchronously or asynchronously (depending upon options passed)
 /// </summary>
 /// <param name="eMailOptions">eMail User State options</param>
 /// <returns>True if email is sent successfuly</returns>
 public static bool SendEMail(SendEmailOptions eMailOptions)
 {
     return SendEMail(eMailOptions.eMailSettings, eMailOptions.subject, eMailOptions.message, eMailOptions.jobLog, eMailOptions.asyncCallBackHandler, eMailOptions.forceAysncCallBack);
 }