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>"
- SalesInfo7 years agoQrew Assistant CaptainMark_Shnier,
I copied and pasted your code into the URL formula field but the mailto keeps popping up as an error (see below). Can you please help me fix this problem? Thanks! - MichaelMichael37 years agoQrew TraineeThis works:
// 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))
- QuickBaseCoachD7 years agoQrew Captain@sales info, please do not post code by a screen shot. no one can read it and its not editable.
If you have a syntax error, post the code by copy and paste of the code, and also post the error message which includes the underlining. - SalesInfo7 years agoQrew Assistant CaptainMichael,
I created 3 variable called email1, email2, email3. I am having a problem with the second variable. Can you please check my variables below. Also, what Do I need to do next after creating three variables?
The first variable: email1var text URLONE = "MailTo:" & URLEncode([Email]) &"?subject=THIS IS A TEST" &"&body=TYPE THE BODY OF YOUR EMAIL HERE. THIS IS A TEST"
&"%0A" &"%0A";
The second variable: email2var text URLTWO = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&" & "rid=" & URLEncode([Record ID#]) //DO I HAVE TO CHANGE [Record ID#]? & "&_fid_91=1";
var text URLTHREE = URLRoot()
& "db/"
& [_DBID_TICKETS] // THE TABLE IS CALLED "Tickets"
& "?a=dr&rid=" & [Related Campaign]; // I DON'T GET THIS PART. IS IT THE ID OF THE TICKET table // How do I know the ID number for the tickets table? The third variable: email3$URLTWO
& "&rdr=" & URLEncode($URLTHREE)
& URLEncode("&rdr=" & URLEncode($URLONE))
After creating three variable above, what am I supposed to do next? How do I create a button on the ticket table?
Please help. Thanks so much!!