Use URL Encode. These are my notes. I am not totally sure if it works with the Ampersand.
var text Subject =
"Enter Subject Line Text here " & [Add Fields If Desired] ;
var text File = URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e57/v0"; //use this if you want to include a file link
var text Body =
URLEncode("Enter text for body here")
& "%0A%0A" //THIS IS A LINE BREAK PLUS SKIPS A LINE
& URLEncode("Company Name: " & [Company Name]) // EXAMPLE OF HOW TO ENTER TEXT AND A FIELD
& "%0D%0A" //THIS IS A LINE BREAK, DOES NOT SKIP A LINE
& URLEncode("File Link: " & $File)
& "%0A%0A"
& URLEncode("QuickBase Link: " & [Field]));
var text Email = "mailto:
ThisName@fakeemail.com" //WHAT EMAILS ARE IN THE TO LINE
& "?
cc=ThisName@fakeemail.com" //WHAT EMAILS ARE IN THE CC LINE
& "&subject=" & URLEncode($Subject) //NOTE: If you remove the cc line, then: & "?subject=" & URLEncode($Subject)
& "&body=" & $Body; // The first line after mail to should have a '?' and NO "&". This indicates everything following is being set.
"<a href="
& $Email
& ">" & "Create Email" & "</a>"
------------------------------
Mike Tamoush
------------------------------
Original Message:
Sent: 12-30-2021 17:45
From: Meagan Kellagher
Subject: Button with Mailto link - Code stops working if & is in a field
Hello,
I have a button that generates an email with fields from a specific record. If a field contains any contents with an &, anything below the & will not populate in the email. How can I ensure the Mailto Link allows & characters?
Example:
"mailto:"&""&[Email 1]&
"\n"&"?subject="&"\n"&[Record]&""&
"&body="&"Location Name: "& [Location Name]
"%0D"
&"field2"&
"%0D"
&"field3"&
""
--- If Location Name for the records is AT&T, then the body of the email will be "AT" and nothing after... ---
How can I ensure the mailto link copies the exact field contents without stopping at the & character?
Thanks!
------------------------------
Meagan
------------------------------