This Google Apps Script simplifies bulk email sending directly from a Google Sheet while providing real-time email open tracking.
- Custom Menu Integration
Adds an "Email Sender" menu to your Google Sheet for quick access. - Bulk Email Sending
Sends personalized emails in bulk, pulling dynamic content from your Google Sheet. - Email Open Tracking
Tracks email engagement using a hidden tracking pixel, including:- First Open Time
- Last Open Time
- Total Open Count
- Error Handling
Handles errors gracefully to ensure smooth email sending. - User-Friendly Dialogs
Provides an intuitive modal dialog for email configuration.
-
Set Up Your Google Sheet
Populate the sheet with the following structure:- Column A: Recipient Email Address
- Column B: Email Subject
- Column C: Email Body
- Column D: Last Sent Timestamp (auto-updated)
- Column E: First Open Timestamp (auto-updated)
- Column F: Last Open Timestamp (auto-updated)
- Column G: Total Opens (auto-updated)
-
Send Emails
- Open your Google Sheet.
- Click on the custom Email Sender menu.
- Select Send Emails and input the starting row and number of emails to process.
-
Track Opens
- A hidden tracking pixel is appended to each email.
- Email opens are logged in real-time, updating the Google Sheet automatically.
The script appends a hidden tracking pixel to your email body to monitor opens.
Recipient | Subject | Body |
---|---|---|
john.doe@example.com | Welcome to Our Service! | <p>Hi John,</p><p>Welcome to our service! We're thrilled to have you.</p><p>Best, The Team</p> |
Here’s how the script integrates with your Google Sheet:
-
Replace placeholders in the code:
SHEET_ID
: Your Google Sheet ID.SHEET_NAME
: Your sheet's name.Deploy_URL
: The deployed web app URL for tracking.
-
Add the accompanying HTML file (
form.html
) for the email-sending dialog. -
Deploy the script as a web app:
- Navigate to Extensions > Apps Script in Google Sheets.
- Publish the project as a web app to enable tracking functionality.
- Marketing Campaigns: Manage bulk emails for newsletters or promotional offers.
- Education: Teachers sending updates or assignments to students while tracking engagement.
- Team Communication: Ensure important announcements are read by team members.
Open Tracking is not working. Using only Google App Scripts is impossible to track the statement of emails. I receommend to use Third-Party such as SendGrid, MailGun, or others.