Forum Discussion
... Anyways, here is an example. You should URLEncode anything from a field that might have spaces or special characters.
//"<a href=\
"MailTo:customerservice@gesco.ca"
// the above text invokes the mail client, and creates the TO line
&"?subject=Quick Specials Order"
// the above text does the subject line, below that is the body
// the %0A is a line feed type indicator.
&"&body=Attention SHNIER Customer Service, please order the following for me "
&"%0A%0A"&[Specials List Category - Accessories Group]
&"%0A"& URLEncode([Description])
&"%0A"&"Item Code: " & URLEncode([ITEM#])
&"%0A" & "Price is " & URLEncode([Price & Comment])
& If([Cuts OK?]="OK", " (Price is $1.25 extra for cuts)")
& If([Rolls Only?], " (no cuts allowed on this item)")
&"%0A%0A" & "Qty is " & [Qty Available] & " U/M is " & [UM] & " (Edit Qty as necessary)"
&"%0A%0A" & "My Store name is :"
&"%0A%0A" & "My Tel number is :"
&"%0A%0A" & "My name is :"
&"%0A%0A" & "My Purchase Order is:"
&"%0A%0A" & "My Ship date is:"
&"%0A%0A" & "Special Instructions:"
// OK the URLEncode function is required because putting certain special
// characters into the HTML messed it up. So, since you can't directly
// put an = or & into the string, you need to use the URLEncode function.
&"%0A%0A" & "(Internal use information follows)"
&"%0A" & "Locn: " & URLEncode([Location])
&"%0A" & "Serial: " & URLEncode([Serial#])
&"%0A" & "Shade: " & URLEncode([Shade])
&"%0A%0A" & "Here is a Query for the Item in Quick Specials"
&"%0A" &"https://gesco.quickbase.com/db/xxxxxxxx?a";
& URLEncode("=")& "q" & URLEncode("&") & "qid"
& URLEncode("=") & "65" & URLEncode("&") & "nv"
& URLEncode("=") & "1" & URLEncode("&")
& "v0"& URLEncode("=") & "Item" & URLEncode([ITEM#])
// This last bit creates the words for the link that you click.
//&"\">"&"<b>Order by Email"&"</a>"
// create 3 text variables then execute them in order
// first variable holds the email address & content
var text URLONE = "MailTo:" & URLEncode([EmailAddressFieldName])
&"?subject=TYPE YOUR SUBJECT HERE"
&"&body=TYPE THE BODY OF YOUR EMAIL HERE, IF YOU INCLUDE FIELDS, DO IT LIKE THIS:�
& URLEncode([FieldName])
& "MORE EMAIL BODY UNTIL YOU�RE DONE, THE NEXT BIT IS HOW TO CREATE CARRIAGE RETURNS IN THE EMAIL BODY:"
&"%0A" // this makes a carriage return
&"%0A"; //make sure to include the semicolon to end the variable declaration statement
// this is a little bonus, it checks a box on the record that indicates you�ve sent the email (so you remember not to send it twice)
var text URLTWO = URLRoot()
& "db/"
& Dbid()
& "?act=API_EditRecord&"
& "rid=" & URLEncode([Record ID#])
& "&_fid_91=1"; // this is the checkbox field ID, and you set it to equal 1, which is TRUE or Checked
// this re-loads the page when you�re done
var text URLTHREE = URLRoot()
& "db/"
& [_DBID_CAMPAIGNS] // replace with your table ID name
& "?a=dr&rid="
& [Related Campaign]; // id of the table you�re redirecting to (the button on this case was on a child record, therefor the �related� part...
// this �runs� the script: checks the box, then reloads the page, then sends the email, in that order
$URLTWO
& "&rdr=" & URLEncode($URLTHREE)
& URLEncode("&rdr=" & URLEncode($URLONE))