Fireship · @fireship
Transactional Email 101 📧 with SendGrid & Firebase Cloud Functions
Uploaded July 9, 2019 · Length 8:10
Summary
Learn how to send transactional emails with SendGrid and Firebase Cloud Functions, including welcome emails, HTTP callable functions, and database triggers.
- transactional email
- sendgrid
- firebase cloud functions
- email marketing
- serverless functions
- email automation
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
almost every interactive app sends
- 0:01
event-driven email on a per user basis
- 0:04
in today's video we'll look at the
- 0:05
fundamentals of transactional email
- 0:07
you've got mail we'll look at strategies
- 0:09
for sending email at the right time to
- 0:11
increase user engagement and of course
- 0:13
the technical implementation details
- 0:15
with firebase cloud functions and the
- 0:17
send grid transactional email API and
- 0:19
this is also the first video in a new
- 0:21
series called Minimum Viable Product
- 0:23
where we start with a generic spec or
- 0:25
requirement like how do I send email
- 0:27
from my app then build a full stack
- 0:28
solution with multiple front-end or
- 0:30
back-end approaches in this tutorial
- 0:32
you'll see the backend integration with
- 0:34
cloud functions but if you want to
- 0:35
extend it you can go to fire ship i/o
- 0:37
and see integrations for angular react
- 0:39
view svelte and flutter if you're new
- 0:41
here like and subscribe and leave a
- 0:43
comment below for a chance to win this
- 0:44
t-shirt now the great thing about
- 0:46
serverless functions is that they make
- 0:48
it really easy to implement secure
- 0:50
event-driven code today we'll write and
- 0:52
deploy four different cloud functions
- 0:53
each solving a specific problem the
- 0:55
first one will send a welcome email when
- 0:57
a new user signs up the second one is an
- 0:59
HTTP function that can be called
- 1:01
dynamically from your front-end code the
- 1:03
third one is a fire store function which
- 1:05
runs and responds to changes to the
- 1:07
database and the fourth function is
- 1:09
scheduled which allows you to send an
- 1:10
email at a specific time or date we'll
- 1:13
talk about these strategies in a little
- 1:14
more detail as we go along but let's get
- 1:16
started with the initial setup the first
- 1:18
thing you'll need is a send grid account
- 1:19
which is a paid service but it starts
- 1:21
off with a free tier to get you started
- 1:22
now you'll see a lot of different things
- 1:24
on the send grid dashboard but the thing
- 1:26
we're interested in is the transactional
- 1:28
templates page from this page you'll
- 1:30
want to create a new template and then
- 1:32
add a version to it
- 1:33
you can use your own custom HTML or you
- 1:35
can go to their drag-and-drop editor but
- 1:37
when it comes to dynamic transactional
- 1:39
email you'll basically want to create a
- 1:41
template that allows you to pass in a
- 1:42
bunch of data to customize it on a per
- 1:44
user basis and SendGrid uses handlebars
- 1:47
to achieve this in their templates
- 1:48
you'll notice over here on the left that
- 1:50
we have the subject wrapped in
- 1:52
handlebars that's because we'll be
- 1:53
dynamically passing the subject from our
- 1:55
back-end functions then in the email
- 1:57
body we have hello handlebars name which


