Пример #1
0
        /// <summary>
        /// Sends the mail.
        /// </summary>
        /// <param name="from">From.</param>
        /// <param name="to">To.</param>
        /// <param name="subject">Subject.</param>
        /// <param name="body">Body.</param>
        /// <param name="isBodyHtml">If set to <c>true</c> is body html.</param>
        public void SendMail(UserDto from, List <UserDto> to, string subject, string body, bool isBodyHtml)
        {
            EmailTask mail = new EmailTask();

            mail.From.EmailAddress = from.EmailAddress;
            mail.To.AddRange(to);
            mail.Subject    = subject;
            mail.Body       = body;
            mail.IsBodyHtml = isBodyHtml;

            SendMail(mail);
        }
Пример #2
0
        /// <summary>
        /// Sends the mail by template.
        /// </summary>
        /// <param name="from">From.</param>
        /// <param name="to">To.</param>
        /// <param name="templateId">Template identifier.</param>
        /// <param name="model">Model.</param>
        /// <typeparam name="TModel">The 1st type parameter.</typeparam>
        public void SendMail <TModel>(UserDto from, List <UserDto> to, long templateId, TModel model)
        {
            EmailTask mail = new EmailTask();

            mail.From = from;
            mail.To.AddRange(to);

            // TODO: need to realize mail template engin.

            // Get mail template from database.

            // Transform subject

            // Transform body

            throw new NotImplementedException();
        }
Пример #3
0
        public void SendMail(List <UserDto> to, string subject, string body, bool isBodyHtml)
        {
            UserDto mailFrom = new UserDto
            {
                EmailAddress = smtpEmailSenderConfiguration.DefaultFromAddress,
                FullName     = smtpEmailSenderConfiguration.DefaultFromDisplayName
            };

            EmailTask mail = new EmailTask();

            mail.From = mailFrom;
            mail.To.AddRange(to);
            mail.Subject    = subject;
            mail.Body       = body;
            mail.IsBodyHtml = isBodyHtml;

            SendMail(mail);
        }
Пример #4
0
 /// <summary>
 /// Sends the mail.
 /// </summary>
 /// <param name="mail">Mail.</param>
 public void SendMail(EmailTask mail)
 {
     backgroundJobManager.Enqueue <EmailSenderJob, EmailTask>(mail);
 }