Question

I have a public facing site with a "Contact Us" SharePoint list. Users are able to submit a new request through a custom Web Part which creates a SP List item using server side code.

After the list item is created, a SP Designer workflow is triggered and sends an email to the appropriate users.

In order to create the list item when there's no user logged in, I had to run the snippet with Elevated Privileges. Therefore, the SP List item is created under "System Account" and this is why I assume the workflow never starts.

  1. Should I impersonate a specific user in my server side code when creating the item?
  2. Should I send the email using code instead of using a SP Designer Workflow?

Any help would be greatly appreciated

Was it helpful?

Solution

Either option would work, but since you are doing it server side already, I'd handle the emailing from there as well.

If you want to give users the ability to change up the SPD workflow at any point, then impersonating a created by user would be better so you don't have to redeploy changes.

I guess it boils down to developer convenience vs end user customization.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top