Hello,
I am currently trying to compose a new Outlook email upon clicking a link from the Appian interface. I am unable to insert a line break in the body of the email. Any thoughts on how to resolve this issue ?
Thanks,
Sidd
{ a!richTextDisplayField( value: { a!richTextItem( text: "Click to send Email ", link: a!safeLink( uri: concat( "mailto://abc@xyz.com?subject=Test Email &cc=qwe@xyz.com &Body=", "Hello " & char( 10 ) & "user" ) ), size: "MEDIUM" ) } ) }
Discussion posts and replies are publicly visible
Use "%0D%0A" as a line break. Replace "char(10)" with "%0D%0A".
{ a!richTextDisplayField( value: { a!richTextItem( text: "Click to send Email ", link: a!safeLink( uri: concat( "mailto://abc@xyz.com?subject=Test Email &cc=qwe@xyz.com &Body=", "Hello " & "%0D%0A" & "user" ) ), size: "MEDIUM" ) } ) }
confirmed - works for me in chrome / outlook. It also works for me with just "%0A".
I was originally going to comment that Appian itself likely strips out any special characters (like newline) from the URI, but I wasn't clear whether there was a URL encoding that could be used - so thanks for clarifying.
Thanks Ashvin - it worked.
Hi, I know this is an old thread but need help on this topic from the community.
I am using mailto to open an email in Outlook with body pre-populated as well. However, I am not sure how I can introduce line breaks using a rich text editor to compose a body. Has someone tried this before?
Also, are there any character limitations when we use mailto?
Any text you want to put in that mailto URL needs to be URL encoded. Use the function urlwithparameters() to do that. Then your line breaks will be encoded correctly. Beware that there are certain limitations in the length of that URL.
Thanks Stefan!
The urlwithparameters() function worked for generating the proper url to be used in the safeLink(). However, it still could not get rid of the <div> and <br> tags, so I used striphtml() to achieve that.
The max char limit is 1274 as per my testing. I wish it was more!
local!url: urlwithparameters( concat("mailto:",ri!emailMessage.to), {"cc","subject","body"}, {ri!emailMessage.cc,ri!emailMessage.subject,striphtml(ri!emailMessage.body)} )