Members-only tutorial

Watch the video and get the practice sheet with membership.

See membership options

Send a Button from Google Sheets in an Email

About this Tutorial

quick fun video to show you how to add a button to emails when you send emails from Google Sheets.

Video Transcript

<div>0:00 Do you want to send a button in an email from a Google sheet? Just like this. This is an actual email that I've sent to myself and this is a button.<br>0:09 This actually works. It's a link to YouTube. Let me show you how to use this or how to implement this.<br>0:17 So, in our Google sheet, all I have is in B1, I have some text and in B2, I have the URL that I want to send.<br>0:24 And that button too. So, let's go to an extensions app script Learn about Google Apps Script and how it enhances your Google Sheets experience. Opens in new tab . Now, here I've created a function Discover what functions are and how to use them in Google Sheets. Opens in new tab send email.

And I'm just sending it to myself.<br>0:39 This is just me as the owner Understand the role of the owner in Google Sheets and their permissions. Opens in new tab of the spreadsheet Get to know what a spreadsheet is and its components in Google Sheets. Opens in new tab or whoever is the owner Understand the role of the owner in Google Sheets and their permissions. Opens in new tab . You can replace this with text, email address, anything.<br>0:47 The subject is just, the word button. The URL, we're grabbing from spreadsheet Get to know what a spreadsheet is and its components in Google Sheets. Opens in new tab app that get active spreadsheet Find out how to reference the active spreadsheet in your scripts. Opens in new tab , that get sheet by name.<br>0:54 Sheet one. So, you can say any sheet name Learn how to work with sheet names in Google Sheets. Opens in new tab there. Get range Explore what ranges are and how to manipulate them in Google Sheets. Opens in new tab B two. And B one here for the text.<br>1:03 Now, here's where Understand the query where clause for filtering data in Google Sheets. Opens in new tab the magic happens. We're going to create a variable called HTML body. This is in, not just single quotes.<br>1:11 Boats. But actually, back ticks.

So, this back tick on a Mac is just under the escape button, in the upper left corner on a, And why we're doing this is so that we can fill in the URL with just this dollar sign Learn about the dollar sign in Google Sheets and its significance. Opens in new tab , and curly brackets, and, And this URL variable, this is called interpolation.<br>1:40 And here's all the magic, we're creating an, A with an Href style. It's gonna be background, color. We have text decoration, none, padding.<br>1:51 Uh, you can increase this or decrease it as you wish.

We have a margin as well, and a border radius, so that you have that rounded corners.<br>2:00 We display, In block font family, you can change this if you want, you can even change the font size. And I added a little border bottom here, four pixels, and solid, and here's the color.<br>2:11 This is just a slightly different color than the color of the background here, this red. And then, we're using Gmail app, send email, we're sending it to the owner Understand the role of the owner in Google Sheets and their permissions. Opens in new tab , or whatever.<br>2:24 Whatever. Or email address you want. We're sending a subject, just some text.

The text body here is just a fallback.<br>2:30 Uh, I wrote this email, or sorry, this URL, and added the URL. Uh, it's a fallback if who you're sending to doesn't accept HTML emails.<br>2:42 But then we're putting in curly brackets, an option, which is HTML body with a capital B. Cold. And then the variable that we've called HTML body.<br>2:53 That is all we're doing here.

If you want to see more, I have more and better sheets about sending emails and automating that from App Script Learn about Google Apps Script and how it enhances your Google Sheets experience. Opens in new tab .<br>3:05 And if you're not watching this on bettersheets.co, become a member today because down below, you get access to this sheet and this exact- exact.<br>3:13 Script. Over on bettersheets.co, every tutorial comes with every sheet.</div>