Changing the FROM address on a SharePoint 2013 email workflow

Issue: Can’t change the FROM address in SharePoint Online with a “send an email” action created through workflow.

Workaround: Call the HTTP Web Service Action

    1. Create a site workflow or a list workflow.
    2. Set the Go to Stage to End of Workflow.workflow_EndOfWorkflow
    3. Create a new variable called: variableUsers. Type: String.
    4. Set a workflow variable action to Workflow Context: Initiator. (This is who will be emailed)workflow_variableusers
    5. Add a Replace Substring in a String action.workflow_Replace_Substring
    6. Replace ; with “,” (The quotation marks should be included) in a variable called variableUsers.(email address, semi-colon delimited)  With the Output to itself the, Variable: variableUsers.workflow_replace_substring_defined
    7. Create a 2nd replace action, this time replace a \ with \\ in Variable: variableUsers(email address, semi-colon delimited), with the output to itself again. workflow_replace_substring2
    8. Set a new workflow variable action to variableUsers with [” and “] on each side, it should look like:  [“[%Variable: variableUsers%]”] as a string in the String Builder.workflow_string_builder
    9. Now create an action called Build Dictionary. This dictionary will have 5 variables. Create a new dictionary variable – Output to Variable: requestBody.workflow_dict_variable
      Name Type Value
      properties/__metadata/type String SP.Utilities.EmailProperties
      properties/Subject String Hello
      properties/From String validSPUser@contoso.com
      properties/Body String This is the email body and the HTML of a normal send an email action can be copied into this value.
      properties/To/results Dictionary variableUsers
    10. Create a second Build Dictionary Action. Create a new dictionary variable – Output to requestHeaders.workflow_dictionary2
      Name Type Value
      Accept String application/json; odata=verbose
      Content-Type String application/json; odata=verbose
    11.  Add a Call HTTP Web Service Action.workflow_call_Http
    12. Under “this” HTTP web service select the “…”. Click Add or Change Lookup – Workflow Context: Current Site URL, after the lookup type
      /_vti_bin/client.svc/sp.utilities.utility.SendEmail. So, it should look like:

      [%Workflow Context:Current Site URL%]/_vti_bin/client.svc/sp.utilities.utility.SendEmail

    13. Change the HTTP method to HTTP POST.
    14. Under the request select the requestBody variable.
    15. On the far right of the Call HTTP Web service action select the arrow and click Properties. Under the RequestHeaders dropdown select the variable requestHeaders.workflow_request_headers
    16. Publish and run the workflow.workflow_FROM_complete

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

One thought on “Changing the FROM address on a SharePoint 2013 email workflow

  1. Donald P August 20, 2021 / 3:03 pm

    Is this method still valid?

    Like

Leave a comment