Quick Base Discussions

Expand all | Collapse all

Mailto - more than 1 email address in the CC

  • 1.  Mailto - more than 1 email address in the CC

     
    Posted 08-20-2017 18:57
    Here is the top part of the formula I'm using to automate the sending of an email to specific users:

    var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_662=" & ToText(Today());

    var text URLTWO= 

    "MailTo:"& URLEncode([Contact Main Email])
    &"&cc="& URLEncode([Contact Secondary Email])
    &"&bcc=email@email.com"
    // the above text invokes the mail client, and creates the TO line
    &"?subject=" &  "Store " & [Store No] &  " POS Checkout Site Readiness Survey"

    I need to BCC two email addresses. These addresses will always be the same for every email. Is there a way to have two emails in that line? I've tried putting a ; after the first email and then putting the second, but this doesn't seem to work.

    While we are at it, is there a way to change the From to a specific email address? I have been having to change that manually to make it come from our project mailbox, rather than my personal email.

    Thank you,

    Kim


  • 2.  RE: Mailto - more than 1 email address in the CC

    Posted 08-20-2017 19:25
    The ? is the indicator that the rest of the parameters follow, so it needs to be first.


    "MailTo:"& URLEncode([Contact Main Email])
    & "?subject=" & URLEncode("Store " & [Store No] &  " POS Checkout Site Readiness Survey")

    & "&cc="& URLEncode([Contact Secondary Email])
    & "&bcc=email@email.com;Fred.flintstone@bedrock.com


  • 3.  RE: Mailto - more than 1 email address in the CC

     
    Posted 08-20-2017 23:29
    Thanks Mark. I moved the subject line up and put in the extra email address. When I click on the button it just opens a blank tab. I took out the extra email address and it works fine. Were you able to get this to work with more than one email?


  • 4.  RE: Mailto - more than 1 email address in the CC

    Posted 08-21-2017 01:11
    Yes. It did work for me. I will test in the morning.


  • 5.  RE: Mailto - more than 1 email address in the CC

    Posted 08-21-2017 13:58
    I tested this code and it works in Gmail and Outlook as mail clients
    var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#])
     & "&_fid_14=" & ToText(Today());



    var text URLTWO= "mailto:" & "fred.flintstone@bedrock.com"
    & "?subject=" & URLEncode("this is the subject")
    & "&cc=barney.rubble@gmail.com"
    & "&bcc=email@email.com;fred.flintstone@gmail.com"
    & "&from=mshnier@gesco.ca";

    $URLONE 

    & "&rdr=" & URLEncode($URLTWO)

    Can you post your code that is not working?  maybe there is an extra space somewhere or a syntax error.


  • 6.  RE: Mailto - more than 1 email address in the CC

     
    Posted 08-23-2017 12:56
    Thanks Mark. I got the second email to start populating in the BCC field, but the From: still shows as "Outlook". Here is my code:

    var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_47=" & ToText(Today());

    var text URLTWO= 

    "MailTo:"& URLEncode([Store No - Contact Main Email])
    &"?subject=" &  "Store " & [Store No] &  " POS Checkout Site Readiness Survey and Install Guides / Guides Sondage de pr�paration du site et installation pour les caisses enregistreuses"

    & "&cc="& URLEncode([Store No - Contact Secondary Email])
    & "&bcc=checkout@cantire.com;RSSECLEVEL@cantire.com
    & "&from:=checkout@cantire.com


  • 7.  RE: Mailto - more than 1 email address in the CC

     
    Posted 08-23-2017 12:58
    Also, is there a limit to the number of characters you can have in a formula URL?  I'm creating a bilingual email. It was working fine until I added in some extra text. No errors, and the new tab opens, but it just stays blank. If I take out the extra line of text, the new tab opens to outlook and works correctly.


  • 8.  RE: Mailto - more than 1 email address in the CC

    Top
    Contributor
    Posted 08-23-2017 12:59
    There is no from parameter supported in the mailto protocol. Doing so would be a security issue as you could impersonate any email address.


  • 9.  RE: Mailto - more than 1 email address in the CC

     
    Posted 08-23-2017 13:12
    That makes perfect sense. Thanks for your reply!


  • 10.  RE: Mailto - more than 1 email address in the CC

    Posted 08-23-2017 13:17
    Special characters will mess up the form so they need to be URL encoded.  Keep in mind that you are building a URL.  It's not the length that is the problem as the URL can be extremely long.  Internet Explorer most restricted in length but its limit is still over 2,000 characters long.

    Try this
    var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_47=" & ToText(Today());

    var text URLTWO= 

    "MailTo:"& URLEncode([Store No - Contact Main Email])
    &"?subject=" &  URLEncode("Store " & [Store No] &  " POS Checkout Site Readiness Survey and Install Guides / Guides Sondage de pr�paration du site et installation pour les caisses enregistreuses")

    & "&cc="& URLEncode([Store No - Contact Secondary Email])
    & "&bcc=checkout@cantire.com;RSSECLEVEL@cantire.com

    You will see that I URLEncoded the Subject line.  I removed the from.

    I tested it and that worked - almost.  The issue will be the �  in pr�paration.  Quick Base is not great at handling alternative character sets.  So you may have to drop the � and go with e to get that to work.

    Sometimes in French it is easier to get away with dropping the accents if the words are in caps.  ie you may need to ask your French support staff  which is the least worst, just going with e or making that whole subject line in UPPER CASE.

    If you need to remind the users to change the "from" manually in Outlook, then you can add some instructions  in the body like

    & "&body="& URLEncode("attention: remember to remove this note and change the from to xxxxxx and remember to attach the readiness Survey")


  • 11.  RE: Mailto - more than 1 email address in the CC

    Posted 08-20-2017 19:30
    ... I don't know if there is a way to change the from

    According to this post here, you cannot change the from as there is no recognized parameter for "from".

    https://yoast.com/dev-blog/guide-mailto-links/