1

I've created a workflow that will send out an email to individuals with site access anytime a document is added to a document library. This workflow is replicated across several sites and the intended recipients of the email change with each site. The workflow allows some degree of customization of the email, which is why I created a workflow instead of using alerts. However, there is one thing I haven't been able to figure out. I would like the body of the email to read something like this:

Dear [individual],

A new document has been added to your SharePoint site [site]. Please follow this link [link] to access it.

You received this email because you are listed as the contact for [department]. If you are no longer the contact for [department], please email ***********@***.com with the updated contact information.

Where everything within [ ] is unique to the individual receiving the email. In other words, I want to iterate over individuals in a list and send out an email unique to them. I feel like there should be a way to accomplish this, but after quite a few hours of research I've come up empty handed. Any help would be greatly appreciated. Thank you.

0

I assume this is a global workflow that you're sharing across multiple sites and/or libraries. If so, I've done what you're referring to, and the trick is to match column values in your list with variables from the workflow context.

For instance, say you have your list set up so that for each department it lists the name of a person who should be the primary contact. Your workflow would have to perform the following steps in order:

  1. Populate variables from the workflow context. For example, assuming your sites match up with departments, your "CurrentSite" variable would be "HR" or "Accounting", etc. - whatever the current site title is.
  2. In the condition for your email, check the value of the variable. For example, the workflow would say IF "CurrentSite" is "HR", send this email; ELSE IF "CurrentSite" is "Accounting", send this email, etc.
  3. Now in the actual emails you're sending for each department, you want to do a lookup from your list, and you want the item where the "Department" column matches up to your "CurrentSite" variable.

Of course, I have to point out that using SharePoint groups is far easier. If each site has its own "Owners" or "Primary Contacts" group, all you have to do is send the email to that group. Both methods will eliminate the need to update any hard-coded names or email addresses, but the list method now means that A) whatever account is running the workflow needs access to the list, and B) you now have a separate list to maintain.

0

In SharePoint 2013 designer workflow, you can achieve this by taking the following steps:

Step 1. When you launch the email dialogue, start typing in static content. This is the content that will always be in all emails. In this case, "Dear.." is the static content.

Step 2. Click on "Add or Change Lookup" enter image description here

Step 3. Now you are ready for the dynamic content. This is what you want changed based on whom the item is assigned to. For example, if it's assigned to John, you want it to read "Dear John" but say next week you assign it to Rachel, the system will automatically send to "Rachel" without you having to manually edit.

So, In the "String Lookup Dialogue" that pops up, make sure data source is "current item" as you want this email to go out based on this item this email is about; then in the "Field from Source" - select the column title under which you have the person listed for this task. Then in "Return Field As", select "Display Name" to show the person's name as natively as possible. Then click OK.

enter image description here

Then type your other static content. In this case:

"A new document has been added to your SharePoint site "

and then for the dynamic portion, follow Steps 2 and 3.

Repeat this process for all the rest of the dynamic processes. And you should be good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.