Quick overview
This workflow runs a win-back email campaign from Google Sheets using OpenAI to write emails, Gmail to send and draft replies, and Slack for approvals and reporting, while tracking sends, follow-ups, unsubscribes, and reply outcomes back in the sheet.
How it works
- Runs on three schedules: weekdays to send win-back emails, hourly to check Gmail for replies, and Mondays to post a weekly report to Slack.
- Reads Customers, Suppression, and Approvals tabs from Google Sheets and selects follow-ups due first and then new consented customers up to the daily limit.
- Uses OpenAI to generate a small sample for any new or changed offer, validates the content, and requests approval in Slack before sending anything.
- Uses OpenAI to write the remaining emails, validates each message (name, booking link, numbers/dates, length), then sends approved messages via the Gmail API in-thread for follow-ups and records status and thread IDs back to Google Sheets.
- Posts a daily Slack summary showing how many emails were sent or held and why, plus how many consented customers remain.
- Every hour, searches Gmail for campaign replies and unsubscribe messages, classifies bounces and opt-outs in code, and uses OpenAI to categorize other replies and draft responses when possible.
- Updates Google Sheets with reply status and summaries, adds bounced/unsubscribed addresses to the Suppression tab, labels handled messages in Gmail, creates Gmail reply drafts for interested/questions, and posts a Slack alert with reply highlights.
- On Mondays, aggregates campaign metrics from Google Sheets and posts a weekly performance report to Slack.
Setup
- Add credentials for Google Sheets OAuth2, Gmail OAuth2 (with permission to read and send), Slack OAuth2, and an OpenAI API key.
- Run the manual setup to create the “Win-back Campaign” Google Sheet and the Gmail label, then copy the generated sheetId and handledLabelId into the Campaign Settings.
- Fill in Campaign Settings values (business details, offer, booking link, Slack channel ID, limits, follow-up timing, and optional FAQ/offer end date) and set the workflow timezone.
- Populate the Customers tab with recipients and set consent to “yes”, and optionally preload the Suppression tab to exclude addresses you should never email.
Requirements
- Gmail, Google Sheets, Slack and an OpenAI API key. Only email people who agreed to hear from you, and follow the email marketing rules where you and they live.
Customization
- Change the daily limit, sample size and follow-up timing in Campaign Settings, and the send time in Every Weekday at 10.