Bit of a weird, one off sort of thing. I was creating a workflow in SharePoint which would send an email. On this email would be an “Approve” and “Decline” button. The decline button was easy enough to do but the approve button turned out to be a complete pain in the back side.
First of all, I would like to tell you to not use mailto whenever you can. There are better programs out there. Trust me. If anyone knows any really good ones that they standby please feel free to leave a comment.
The mailto syntax is basically this:
mailto:RECIPIENT?cc=CCRECIPIENT&subject=SUBJECT TEXT&body=BODY TEXT
This looks simple enough but once you want to start doing some more complicated features/formatting that would otherwise be quite simple in HTML, become near impossible here. Especially with it being in a SharePoint string builder box.
What I wanted was for there to be three lines of text, two in which got information from the SharePoint form to fill in the information and one for adding text. By the way if you didn’t know, to add a new line you can use “%0d0d“.
That’s: percent sign – zero – delta – zero – delta
This is the final code that I ended up with:
mailto:RECIPIENT@EMAIL.COM?cc=[%Current Item:Created By%]&subject=Approval Authorisation for [%Current Item:Created By%]&body=The remote access request for [%Current Item:Created By%] has been approved by [%Current item:Manager's Name%]%0d%0dThe reason for approval is - [%Current Item:Reason for approval%]%0d%0dPlease specify any limitations below:
Here is a picture just in case you want to see it and below that what the actual email looks like:
I would like to add that you will have to change the “Add or Change Lookup” so that it finds the “Display Name”, otherwise the users will show as the default SharePoint format which isn’t as good looking. You can see this below:
Hope you enjoyed and found this useful. I may to an entire blog trying to outline the possibilities of using the SharePoint string builder and “Define E-Mail Message” features. Suppose you’ll have to wait and see.