Forum Discussion
- MarkShnierQrew CadetThis is an example of a URL formula field to invoke the user's default mail client. The are some lines commented out that would turn it into a formula-text field as an href type link. But in the new UX when you click those on a report the record also opens up, which is most confusing to users.
... 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>"- SalesInfoQrew 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! - MichaelMichael3Qrew 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))
- KarenHenkeQrew CadetThank you very much! Was able to figure out 97% of what I need to do :)
Two remaining questions:
1. Is it possible to have QuickBase look at my Program Manager field to get the "To" info for the email?
2. What do I put at the end of the sentence below to create a link back to the record from which the email was initiated?
Please contact me about this record: (this is where I'd like to have a link back to the record)
Thank you again! - MarkShnierQrew Cadetno problem
Create a Formula email field [Program manager email] with the formula UsertoEmail([program manager]) and include that in the Mailto like
"MailTo:" & URLEncode([Program manager email])
I'm not sure if you need to URLEncode it, but it shouldn't hurt just in case the @ in email addresses is an illegal character.
As for the last part you should be able to simply have a line like
&"%0A%0A" & "Please contact me about this record "
& URLEncode (URLRoot() & "db/" & dbid() & "?a=dr&rid=" & [record ID#]) - KarenHenkeQrew CadetTHANK YOU, THANK YOU, THANK YOU!!!
That did it! :) - MMQrew MemberMark,
how do i embed a form in the email i'm generating? i understand how to embed the form (showing the buttons and fields) in a regular QB notification, but what about this notification that's being generated directly in Outlook?
i've created the button to allow people to "Approve" or "Reject" and tried using the API_Authenticate but i'll have to work on that some more because i'm getting errors. How do i make the hyperlink display in a button like it does within QB??? - QuickBaseCoachDQrew CaptainI do not know of a way to send anything other than basic text in a MAILTO: button. I do not claim to be an expert in MAILTO formatting, but I'm under the belief that the MAILTO is like the lowest common denominator for causing an unknown random "Mail client" to pop up a window. It could end up being Outlook or a gmail webmail screen or whatever the default mail client is for the random user who clicks that link. Since the mailto does not know who will be clicking it, its very basic.
My suggestion is to reconsidering using the built in email Notifications and giving the user a way to specify the email addresses and to manually trigger the email. - MMQrew Memberhow do i add an address to the "CC" line? i've tried this:
"MailTo:name@domain.com?cc=othername@domain.com"&
"?subject=test email"
which results in "name@domain.com" going into the "To:" line as needed, but everything else goes into the "cc" line (including the ? before subject=test email. - QuickBaseCoachDQrew CaptainSe if this helps. its just a random google on "mailto syntax", but think it has your answer. http://www.labnol.org/internet/email/learn-mailto-syntax/6748/
- MMQrew Memberthat's a good one, but it doesn't help me with the error i'm getting in the QB formula button.
even when i type:
MailTo:name@domain.com?cc=othername@domain.com?subject=subjectline
in the browser it generates an email that looks like this:
To... name@domain.com
Cc... othername@domain.com?subject=subjectline
i must be missing something between the "othername@domain.com" and the "?subject=..." pieces. - QuickBaseCoachDQrew CaptainI played with it and I think that the issue is that there can only be on "?" Typically the ? means " and here are all the parameters.
try this
"<a href=\"MailTo:"&[Emails for carrier and others separated by semi colons]
// the above text invokes the mail client, and creates the TO line
& "?cc=test@test.com"
&"&subject="
&[Carrier Subject Line] & " for Trailer " &
// the above text does the subject line, below that is the body
// the %0A is a line feed type indicator.
& "&body=" &[Carrier Body Header]