Setup Guide

Get your re-engagement automation running in 5 steps.

~15 minutes

Prerequisites

Node.js 18+

JavaScript runtime to run the automation

Download Node.js

Email Provider

SMTP credentials from SendGrid, AWS SES, or similar

See options below

User Data

CSV file with emails and last activity dates

See format below
1

Download & Extract

Get the automation package and unzip it

Download reengage-email-v1.zip

Unzip the file to a folder on your server or local machine.

Terminal
unzip reengage-email-v1.zip -d reengage-email
cd reengage-email
2

Install Dependencies

Install the required Node.js packages

Terminal
npm install

This installs nodemailer, node-cron, and dotenv.

3

Configure Email Provider

Set up your SMTP credentials

First, copy the example files:

Terminal
cp config.example.json config.json
cp .env.example .env

Then add your SMTP credentials to .env:

  1. Create account at sendgrid.com
  2. Go to Settings → API Keys → Create API Key
  3. Choose "Full Access" and copy the key
  4. Verify your sender email in Sender Authentication
.env
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=apikey
SMTP_PASS=SG.your_api_key_here
4

Add Your Users

Create a CSV file with your user data

Create data/users.csv with this format:

data/users.csv
email,firstName,lastName,lastActivityDate
john@example.com,John,Doe,2024-12-15
jane@example.com,Jane,Smith,2024-12-20
mike@example.com,Mike,Wilson,2025-01-10

Required columns:

  • email — User's email address
  • firstName — For personalization
  • lastActivityDate — Date of last activity (YYYY-MM-DD)

Also update config.json with your business details:

config.json
{
  "business": {
    "name": "Your Business Name",
    "website": "https://yourbusiness.com",
    "supportEmail": "support@yourbusiness.com"
  },
  "trigger": {
    "type": "no_activity",
    "daysInactive": 7
  }
}
5

Run the Automation

Test and start sending emails

Test first (no emails sent)

Terminal
npm test

You should see which users would receive emails without actually sending them.

Run for real

Terminal
npm start

This starts the scheduler. It will check for inactive users daily at 9 AM (configurable).

Run once and exit

Terminal
node automation.js --once

Keep It Running in Production

Option A: PM2 (Recommended)

Process manager that keeps your automation running

Terminal
# Install PM2
npm install -g pm2

# Start the automation
pm2 start automation.js --name reengage

# Save and set up auto-restart
pm2 save
pm2 startup

Option B: Cron Job

Run daily using system cron

Terminal
# Open crontab
crontab -e

# Add this line (runs at 9 AM daily)
0 9 * * * cd /path/to/reengage-email && node automation.js --once

You're all set!

Your re-engagement automation is now running. Inactive users will automatically receive your email sequence.

Back to Home