Help

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

Solved
Jump to Solution
1063 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Traci_Franssen
5 - Automation Enthusiast
5 - Automation Enthusiast

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?

1 Solution

Accepted Solutions
pcbowers
6 - Interface Innovator
6 - Interface Innovator

@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

image

Gmail (after clicking button)

image

See Solution in Thread

2 Replies 2
pcbowers
6 - Interface Innovator
6 - Interface Innovator

@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

image

Gmail (after clicking button)

image

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