You can automate emails using Google’s programming language, Google Apps Script.
Apps Script uses Google’s version of the JavaScript programming language. It allows users to augment the native functionality of all of Google Drive’s productivity applications, such as Documents, Sheets, Slides, and Gmail.
This page contains lessons that will teach you how to write scripts that leverage Google Apps Script to send email using the GmailApp.
Learn to automate HTML emails using Google Apps Script
Learn to use Google Sheets data in HTML emails
Learn to use Google Forms data in HTML emails