Connecting Google Sheets with Click2Mail Connect
Prepare a sheet, build the integration once in Click2Mail Connect, and add a short script that tells Connect when your sheet changes. After that, a row marked READY FOR C2M is picked up and mailed.
Before you start
Have these ready first. The steps every platform shares, like creating your account and building a template, are in Getting started.
- Click2Mail Connect and a Google account. You connect the Google account in the next section.
- A mail merge template already set up in Click2Mail that matches the piece you want to send.
- A Google Sheet with one row per mail piece, including your address details.
Connect your Google account
Connect needs to see your Google Drive to find your sheets. You do this once, in Connected Accounts.
- In Connect, open Connected Accounts and choose Add Account.
- Choose Google from the list and then Next. Choose the Google account that owns your sheets.
- Review what Google says Connect can see, then choose Continue. Back in Connect you will see the message Connected Account is ready to use.
Google may warn that the app is not verified
At the time of recording, Google showed "Google hasn't verified this app" while connecting. Choose Advanced, then Go to click2mail.com, to continue. The permissions shown include seeing, editing, creating and deleting your Google Drive files. If you would rather check first, ask Click2Mail support before you continue.
Prepare your sheet
Connect looks for three specific columns in your sheet. Add them first, and spell the headings exactly as shown.
- Add a column headed C2M Status. You type READY FOR C2M here on each row you want mailed. Connect then changes it to PUSHED TO C2M once the row has been picked up.
- Add a column headed C2M Result. Leave it empty. Connect writes SUCCESS here once the row has been sent to Click2Mail; if it could not be, the result says so.
- Add a column headed C2M_uniqueID and leave it blank. It only has to exist as a heading. Capital letters do not matter here, but every letter and the underscore must be exact.
- Fill in the rest of your columns, such as first name, last name and address, with accurate, consistently formatted data. One row is one mail piece.
The blank column is required
The C2M_uniqueID column has to exist even though you never fill it in. Without it, submissions are rejected.
Create the integration in Connect
Next, build the integration in Click2Mail Connect and tell it which sheet to watch.
- Open Integrations in the left-hand menu and choose Create Integration, top right.
- Under Name Your Integration, give it a name you will recognise, for example Monthly Campaigns from Google Sheets.
- Set Select C2M Account to your Click2Mail account, Select Data Source to Google, Select Watch Type to Google Sheets Watch and Select Source Account to your connected Google account. Choose Next.
- On the Browse Selected Source screen, choose the folder that holds your spreadsheet, then open the spreadsheet under Select Work Sheet and choose its tab, for example Sheet1. The Work Sheet Columns list on the right shows the headings Connect found. Choose Next.
- On the template screen, choose the Click2Mail template you built for this piece, then choose Next.
Map your fields and approve the proof
Line up your sheet's columns with the fields your template expects, then check the proof. You only do this once.
- On the Fields Mapping screen, each template field has a drop-down. Use it to choose the sheet column that fills that field. If the template wants one full name, combine First Name, a space and Last Name.
- Map only the fields you need. Leaving others unmapped is fine.
- Download the proof and check the layout and the merged details.
- If it looks right, enter three letters as your initials and tick "Yes, I have reviewed the downloaded proof and approve it", then choose Finish.
Do your sums in the sheet first
If a value needs calculating, finish that in the sheet before you mark the row READY FOR C2M, so the finished value is what gets merged.
Copy Connect's Google script
Your sheet tells Connect when something has changed through a short script that Connect writes for you. It already contains your integration's own details, so you never edit it.
- On the Integrations page, choose the information icon (the round "i") beside your integration.
- In the Integration Detail window, next to Google Script, choose "Click here for copy Google Script".
- That copies the script. Keep it on your clipboard for the next step. The same window shows the Spreadsheet Name and Tab the integration is watching.
No API key to find
You never need an API key for this. The script already points at your integration.
Add the script and its trigger in Google
Now paste the script into your sheet and tell Google to run it whenever the sheet changes. This step only applies to Google Sheets Watch.
- Open your Google Sheet and choose Extensions, then Apps Script.
- In the code file (code.gs), delete the sample code and paste in the script you copied. Save it.
- In the left-hand bar, choose Triggers (the clock icon), then Add Trigger.
- In the Add Trigger window, set the function to devGoogleScript and the deployment to Head. They are usually filled in for you.
- Set the event source to From spreadsheet and change the event type from On open to On change, then choose Save.
- If Google asks you to approve permissions so the script can run, approve them.
Set this up once per sheet
After the trigger is saved, every change to the sheet tells Connect to look for rows marked READY FOR C2M. You do not need to touch Apps Script again.
Sending mail from Google Sheets
Once the integration is active and the trigger is saved, sending is a matter of marking rows. Each row is one mail piece.
- Add your mailing data to the sheet, one row per piece.
- In the C2M Status column, type READY FOR C2M on each row you want mailed, or let your own automation write it there.
- Because the sheet changed, the script tells Connect. Connect queues the request and waits 60 seconds in case more changes follow, so a row is usually picked up about a minute after your last edit. C2M Status then changes to PUSHED TO C2M, C2M Result shows SUCCESS, and the piece appears under Pending Requests in Connect.
A handy fallback for any system
Anything that can write to your sheet, including an automation in another system, can start a mailing this way. The change fires the script, and Connect picks up the rows marked READY FOR C2M.
If something goes wrong
I marked a row and nothing happened
Allow about a minute after your last edit to the sheet. If nothing has happened after ten minutes, check three things. First, that the Triggers page in Apps Script lists devGoogleScript with "From spreadsheet, On change", and that the Executions page shows it running. Second, that C2M Status reads exactly READY FOR C2M. Third, that the headings are spelled exactly as shown, including the underscore in C2M_uniqueID.
C2M Result says Failed
Fix whatever is wrong in that row, such as a missing or incorrect field, then type READY FOR C2M again. Connect does not retry failed rows on its own. Failed Requests in Order History in Connect shows the record.
My submission was rejected
Check the C2M_uniqueID column is there and empty. The column has to exist, and filling it in can cause conflicts.
The request keeps failing even though the data looks fine
A common cause is not enough prepaid credit. Add credit, then mark the row READY FOR C2M again.
Still stuck?
Our support team can look at your sheet and integration with you. Get in touch and we will help you get it sending.
Ready to automate your mail?
Connect Click2Mail to the platform you already run on and start sending in minutes. No monthly software fees.
Sign Up