Beispiel #1
0
        private void AreTherePeople2Alert(object sender, ConditionalEventArgs e)
        {
            SRMSharePointWorkflowUtil _lookup = new SRMSharePointWorkflowUtil();
            string emails = _lookup.GetFieldValueUserCollectionEmails(onWorkflowActivated1.WorkflowProperties.Item, "Alerts");

            if (String.IsNullOrEmpty(emails))
            {
                e.Result = false;
            }
            else
            {
                e.Result = true;
            }
        }
Beispiel #2
0
        private void codeActivity3_ExecuteCode(object sender, EventArgs e)
        {
            SRMSharePointWorkflowUtil _lookup = new SRMSharePointWorkflowUtil();

            StringDictionary header = new StringDictionary();

            header.Add("to", _lookup.GetFieldValueUserCollectionEmails(workflowProperties.Item, "Alerts"));

            header.Add("from", "*****@*****.**");

            header.Add("reply-to", workflowProperties.OriginatorEmail);

            header.Add("subject", "Request (" + workflowProperties.Item.Title + ") has been submitted");

            string sendAlert_Body1 = "Following request has been submitted by " +
                workflowProperties.Originator +
               "<br><a href=\"" +
                workflowProperties.WebUrl + "/Lists/" +
                workflowProperties.List.Title + "/" +
                "Dispform.aspx?ID=" +
                workflowProperties.ItemId + "\">" +
                workflowProperties.Item.Title +
                "</a><br>";

            SPUtility.SendEmail(workflowProperties.Web, header, sendAlert_Body1);
        }