Skip to main content
Solved

Trying to add cc&bcc: on Button to openURL to compose Gmail


Forum|alt.badge.img+8

Hi,
I am trying to make a Button that will open a Gmail compose message screen that has the To, CC, BCC, and Subject fields pre-filled.
The CC and BCC are static; To and Subject change depending on the record.

This one works but doesn’t have the cc field, and I want to add a BCC too…
https://mail.google.com/mail/u/0/?authuser=example@gmail.com&view=cm&to=”&{send to email} &"&su="&({load}&" - confirmation")&"&body="&{load numbers}

now trying to add a CC field and it won’t save the formula, get an ‘Invalid Formula’ error
https://mail.google.com/mail/u/0/?authuser=example@gmail.com&view=cm&to=”&{send to email}?cc=traci@example.net&"&su="&({load}&" - confirmation")&"&body="&{load numbers}

What am I doing wrong?

Best answer by pcbowers

@Traci_Franssen You were really close! You missed an ampersand in your CC formula. To make the link work, all you need to do is encode the URL component using the ENCODE_URL_COMPONENT() function. Here is the formula you are looking for:

"https://mail.google.com/mail/?view=cm&fs=1" &
"&to=" &
ENCODE_URL_COMPONENT({send to email}) &
"&cc=" &
ENCODE_URL_COMPONENT("example.cc@test.com") &
"&bcc=" &
ENCODE_URL_COMPONENT("example.bcc@test.com") &
"&su=" &
ENCODE_URL_COMPONENT({load} & " - Confirmation") &
"&body=" &
ENCODE_URL_COMPONENT({load numbers})

I did not know what {load} and {load numbers} represented, and I did not know what static BCC and CC emails you wanted either, so I kept your fields as-is and inputted a couple example emails for BCC and CC. I also changed your starting URL link, removing the /u/0/ part and the authuser part. I believe they are unecessary, though feel free to add them back in if you need them for your use-case.

Here is a screenshot showing how it would work (the screenshot uses {Email}, {Subject}, and {Body} fields so that future people looking at this can make better sense of what is going on):

Airtable

Gmail (after clicking button)

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+9
  • Inspiring
  • 22 replies
  • Answer
  • May 11, 2021

@Traci_Franssen You were really close! You missed an ampersand in your CC formula. To make the link work, all you need to do is encode the URL component using the ENCODE_URL_COMPONENT() function. Here is the formula you are looking for:

"https://mail.google.com/mail/?view=cm&fs=1" &
"&to=" &
ENCODE_URL_COMPONENT({send to email}) &
"&cc=" &
ENCODE_URL_COMPONENT("example.cc@test.com") &
"&bcc=" &
ENCODE_URL_COMPONENT("example.bcc@test.com") &
"&su=" &
ENCODE_URL_COMPONENT({load} & " - Confirmation") &
"&body=" &
ENCODE_URL_COMPONENT({load numbers})

I did not know what {load} and {load numbers} represented, and I did not know what static BCC and CC emails you wanted either, so I kept your fields as-is and inputted a couple example emails for BCC and CC. I also changed your starting URL link, removing the /u/0/ part and the authuser part. I believe they are unecessary, though feel free to add them back in if you need them for your use-case.

Here is a screenshot showing how it would work (the screenshot uses {Email}, {Subject}, and {Body} fields so that future people looking at this can make better sense of what is going on):

Airtable

Gmail (after clicking button)


Forum|alt.badge.img+8
  • Author
  • Participating Frequently
  • 11 replies
  • May 11, 2021
pcbowers wrote:

@Traci_Franssen You were really close! You missed an ampersand in your CC formula. To make the link work, all you need to do is encode the URL component using the ENCODE_URL_COMPONENT() function. Here is the formula you are looking for:

"https://mail.google.com/mail/?view=cm&fs=1" &
"&to=" &
ENCODE_URL_COMPONENT({send to email}) &
"&cc=" &
ENCODE_URL_COMPONENT("example.cc@test.com") &
"&bcc=" &
ENCODE_URL_COMPONENT("example.bcc@test.com") &
"&su=" &
ENCODE_URL_COMPONENT({load} & " - Confirmation") &
"&body=" &
ENCODE_URL_COMPONENT({load numbers})

I did not know what {load} and {load numbers} represented, and I did not know what static BCC and CC emails you wanted either, so I kept your fields as-is and inputted a couple example emails for BCC and CC. I also changed your starting URL link, removing the /u/0/ part and the authuser part. I believe they are unecessary, though feel free to add them back in if you need them for your use-case.

Here is a screenshot showing how it would work (the screenshot uses {Email}, {Subject}, and {Body} fields so that future people looking at this can make better sense of what is going on):

Airtable

Gmail (after clicking button)


Hooray!!! :tada: It’s working now – Thank you so much!!!


Reply