vrijdag 6 juli 2012

SP2010 Sequential Workflow Send Email

Send Email in a sequential workflow

Create a Send Email task activity on your workflow.

Don't forget to set the CorrelationToken to the same token as your workflow! See earlier post. 

The code behind of that task is:

SPUser siteOwner = IntranetUtility.GetSPUser(currentItem, IntranetFieldId.SiteRequest.SiteOwner);
SPUser siteBackupOwner = IntranetUtility.GetSPUser(currentItem, IntranetFieldId.SiteRequest.SiteBackupOwner);

SendEmail confirmationMail = (SendEmail)sender;
confirmationMail.To = siteOwner.Email + ";" + siteBackupOwner.Email;
confirmationMail.Subject = string.Format("Your site {0} is created", currentItem.Title);
confirmationMail.Body = "Link to created site";
SPUtility.SendEmail(workflowProperties.Web, true, false, confirmationMail.To, confirmationMail.Subject, confirmationMail.Body);

Geen opmerkingen:

Een reactie posten