Email Automation
Set up automated email sequences and workflows to engage users at the right time.
Drip Campaigns
Create automated email sequences that send over time:
// Welcome series
const welcomeSeries = [
{ delay: 0, template: 'welcome-immediate' },
{ delay: 24, template: 'welcome-day-1' },
{ delay: 72, template: 'welcome-day-3' },
{ delay: 168, template: 'welcome-week-1' }
];
async function startWelcomeSeries(user) {
for (const step of welcomeSeries) {
setTimeout(async () => {
await sendmator.emails.send({
to: user.email,
template: step.template,
template_data: { user_name: user.name }
});
}, step.delay * 60 * 60 * 1000); // Convert hours to milliseconds
}
}
Trigger-Based Emails
Send emails based on user actions:
// Cart abandonment
async function handleCartAbandonment(user, cart) {
// Wait 1 hour
setTimeout(async () => {
await sendmator.emails.send({
to: user.email,
template: 'cart-abandonment',
template_data: {
user_name: user.name,
cart_items: cart.items,
cart_total: cart.total
}
});
}, 60 * 60 * 1000);
}
Automation Best Practices
- Start simple - Begin with basic sequences
- Test thoroughly - Always test with real data
- Monitor performance - Track open rates and conversions
- Respect unsubscribes - Always honor opt-out requests