Adding body to mailto:XXXX@email.com?Subject=Test in SharePoint list view
-
27-01-2021 - |
Question
I am trying to add body to an email that i sending through JavaScript. I have a SharePoint list view when clicked on sends an email to EmailID.
This works fine,
var mail="mailto:"+emailID+"?Subject=Test:"+ctx.CurrentItem.ID
I am trying to add body of the email. I have tried
var mail="mailto:"+emailID+"?Subject=Test:"+ctx.CurrentItem.ID&body=Test
and
var mail="mailto:"+emailID+"?Subject=Test:"+ctx.CurrentItem.ID;body=Test.
Nothing worked.
Can anyone please suggest.
La solution
Looks like an issue with double quotes.
Try it as below:
var mail= "mailto:" + emailID + "?Subject=Test: " + ctx.CurrentItem.ID + "&body=Some body text";
If you want a dynamic body text, try it as below:
var bodyText= "some body text";
var mail= "mailto:" + emailID + "?Subject=Test: " + ctx.CurrentItem.ID + "&body=" + bodyText;
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange