🎯 Advocacy Campaign Manager
Automate varied advocacy emails to government representatives about Queensland Land Tax reform
Campaign Configuration
Scheduling
Recipients & Preview
No recipients added yet
Email Preview (AI-Generated Variation)
To: [Recipient]
Subject: [Subject]
[AI-generated email body will appear here]
Setup Instructions
How to automate this campaign:
1. Configure your campaign above with your core message and recipients
2. Get an API key from OpenAI (ChatGPT), Claude (Anthropic), or similar AI service
3. Set up automation using one of these tools:
• Zapier/Make.com: Trigger daily → Call AI API → Send email via SendGrid/Gmail
• Node.js Script: Use node-cron + OpenAI SDK + Nodemailer
• Python Script: Use APScheduler + OpenAI API + smtplib
4. AI Prompt: Instruct AI to vary the message while keeping core facts intact
5. Email Service: Use SendGrid, Mailgun, or your email provider’s API
6. Compliance: Include unsubscribe option, space emails 30+ seconds apart, log all sends
1. Configure your campaign above with your core message and recipients
2. Get an API key from OpenAI (ChatGPT), Claude (Anthropic), or similar AI service
3. Set up automation using one of these tools:
• Zapier/Make.com: Trigger daily → Call AI API → Send email via SendGrid/Gmail
• Node.js Script: Use node-cron + OpenAI SDK + Nodemailer
• Python Script: Use APScheduler + OpenAI API + smtplib
4. AI Prompt: Instruct AI to vary the message while keeping core facts intact
5. Email Service: Use SendGrid, Mailgun, or your email provider’s API
6. Compliance: Include unsubscribe option, space emails 30+ seconds apart, log all sends
Sample Automation Code
// Node.js Example with node-cron + OpenAI
const cron = require('node-cron');
const { Configuration, OpenAIApi } = require('openai');
const nodemailer = require('nodemailer');
const openai = new OpenAIApi(new Configuration({
apiKey: process.env.OPENAI_API_KEY,
}));
const mailer = nodemailer.createTransport({
service: 'gmail',
auth: { user: process.env.EMAIL_USER, pass: process.env.EMAIL_PASS }
});
const coreMessage = `For State Government to review Land Tax law...`;
const recipients = [
{ name: 'Hon. John Smith', email: 'john@parliament.qld.gov.au' },
// ... more recipients
];
async function generateVariation(recipientName) {
const response = await openai.createChatCompletion({
model: 'gpt-4',
messages: [{
role: 'user',
content: `Rewrite this message in a different style for ${recipientName}:\n\n${coreMessage}\n\nKeep it 150-250 words, professional, and accurate.`
}]
});
return response.data.choices[0].message.content;
}
// Schedule daily at 9 AM
cron.schedule('0 9 * * *', async () => {
for (const recipient of recipients) {
const emailBody = await generateVariation(recipient.name);
await mailer.sendMail({
from: process.env.EMAIL_USER,
to: recipient.email,
subject: 'Queensland Land Tax Reform - Action Needed',
text: emailBody
});
await new Promise(r => setTimeout(r, 30000)); // 30 sec delay
}
});
