Exemple #1
0
        private void Create_RecipientsReports_ExecuteCode(object sender, EventArgs e)
        {
            string nazwaBiura = DB.admSetup.GetValue(workflowProperties.Web, "BR_NAZWA");

            foreach (Recipient recipient in alRecipients)
            {
                MailMessage msg = new MailMessage()
                {
                    Subject = recipient.GetSubject(),
                    Body    = recipient.GetBody(WysylkaMonitu.Get_MessageLayout(workflowProperties.Web)),
                };
                foreach (MailAddress ma in recipient.To())
                {
                    msg.To.Add(ma);
                }

                StringBuilder sb = new StringBuilder(msg.Body);
                sb.Replace("[[NazwaBiura]]", nazwaBiura);

                msg.Body       = sb.ToString();
                msg.IsBodyHtml = true;

                //add standard layout
                sb = new StringBuilder(BLL.dicSzablonyKomunikacji.Get_HTMLByKod(workflowProperties.Web, "EMAIL_DEFAULT_BODY"));
                sb.Replace("___FOOTER___", string.Empty);
                sb.Replace("___BODY___", msg.Body);
                msg.Body = sb.ToString();

                SPListItem m = WysylkaMonitu.Send(workflowProperties.Web, msg, recipient.ID);
            }
        }
Exemple #2
0
        private MailMessage InitMessage(string subject)
        {
            oMsg = new MailMessage()
            {
                Subject = subject,
                Body    = WysylkaMonitu.Get_MessageLayout(workflowProperties.Web)
            };
            oMsg.To.Add(new MailAddress(workflowProperties.OriginatorEmail));

            return(oMsg);
        }