How to do a mail merge in gmail 2018

A blast from the past! While Gmail doesn't have a built-in mail merge feature, you can still achieve a similar result using a combination of Google Sheets, Google Forms, and Gmail's canned responses. Here's a step-by-step guide to help you do a mail merge in Gmail (2018 edition):

Prerequisites:

  1. A Google Sheets document with your data (e.g., names, addresses, and messages)
  2. A Google Form to collect data from your spreadsheet
  3. A Gmail account with access to canned responses

Step 1: Prepare your data in Google Sheets

  1. Create a new Google Sheet or open an existing one.
  2. Set up your data in columns, with each column representing a field (e.g., Name, Address, Message).
  3. Make sure your data is organized and formatted correctly.

Step 2: Create a Google Form

  1. Go to Google Forms and create a new form.
  2. Add fields to your form that match your spreadsheet columns (e.g., Name, Address, Message).
  3. Set up the form to collect data from your spreadsheet.

Step 3: Connect your Google Form to your Google Sheet

  1. Go to your Google Form and click on the "Responses" tab.
  2. Click on the "Get responses" button and select "Connect to a spreadsheet".
  3. Choose the Google Sheet you created in Step 1.

Step 4: Create a canned response in Gmail

  1. Log in to your Gmail account and go to the "Settings" icon (gear icon) in the upper right corner.
  2. Click on "See all settings".
  3. Go to the "General" tab and scroll down to the "Canned responses" section.
  4. Click on "New canned response" and create a new response with a subject line and body text.
  5. Use placeholders (e.g., {Name}, {Address}, {Message}) to insert data from your spreadsheet.

Step 5: Use Google Apps Script to automate the mail merge

  1. Go to your Google Sheet and click on "Tools" > "Script editor".
  2. Delete any existing code and paste the following script:
    
    function sendMergedEmails() {
    var sheet = SpreadsheetApp.getActiveSheet();
    var data = sheet.getDataRange().getValues();
    var form = FormApp.getActiveForm();
    var responses = form.getResponses();

for (var i = 0; i < data.length; i++) { var row = data[i]; var name = row[0]; var address = row[1]; var message = row[2];

var cannedResponse = GmailApp.getCannedResponse("Your Canned Response Name");
cannedResponse.setSubject("Your Subject Line");
cannedResponse.setBody("Hello " + name + ",\n" + message + "\n" + address);
cannedResponse.send();

} }


Replace "Your Canned Response Name" and "Your Subject Line" with the actual names you used in Step 4.

**Step 6: Run the script and send the emails**

1. Go back to your Google Sheet and click on "Run" > "sendMergedEmails".
2. The script will iterate through your data, replacing placeholders with actual values, and send an email to each recipient using your canned response.

That's it! With these steps, you've successfully done a mail merge in Gmail using Google Sheets, Google Forms, and Gmail's canned responses.