Blog Article

Onboarding new user installs from the Google Workspace Marketplace with Mailjet using Google Apps Script

Published: October 10, 2022

People installed your Addon from the Google Workspace Marketplace! Congrats! Now you want to email them. How can you do this at scale with minimal cost? Mailjet is how I do it, read on for more details ;)

In a previous post I detailed how to track your installs from the Google Workspace Marketplace with the Marketplace API. Now lets kick off an onboarding process to email our new users. One method could be to use Apps Script and the built-in MailApp.sendEmail() or GmailApp.sendEmail() methods. The problem you hopefully run into is scale. You will only be able to send a limited number of emails (based on your account type and associated email quota) per day. Sure you could build in some processes (and I started to) but found Mailjet was a great solution for me that ends up costing me about US$40 per month. I can send up to 60,000 emails a month on this plan and it doesn't matter how many contacts I have. Yes, that can add up but it saved me so much time in setting it up and there are some cool things you can add on (no pun intended) later. They also have a free plan that you can start out with so no up-front cost penalty. Also Mailjet is GDPR compliant and has a nice API which made it easy to integrate. I have no affiliation with them but use it with great results.

OK, now that the sales pitch is over let's hook in the Mailjet integration into our code.

Apps Script Integration:
I use the Mailjet Send API v3.1 with a Template: The Template is great as I can build it in Mailjet with their Drag & Drop editor. Screenshot of Mailjet Template Editor I just pass the TemplateID in the payload and it sends :) Screenshot of Apps Script code to send mail by Mailjet

Link to code in Github:

I just add 1 line of Code to the Workspace Install code from the previous post to call this function with the installed user's email. Screenshot of Apps Script code to call Mailjet Send from our main function

Now once a user installs our Addon from the Google Workspace Marketplace, we will automagically send them a Welcome Email!

Hit me up on Twitter or LinkedIn if you have questions.