LoveableSpammer should only be used for good — never ill!
Do you wish you could take html and easily send it out to a group of people? LoveableSpammer is for you.
- First, create compelling content — this is always the hardest part. Design
your email in your favorite html utility, OR start with MailChimp's excellent blueprints,
which you can do with a
git clone https://github.com/mailchimp/email-blueprints - Create a sqlite database file named uit.db with the following schema:
CREATE TABLE maintargets
(name VARCHAR(255),
lastname varchar(255),
emailAddr VARCHAR(255),
dept VARCHAR(255),
bldg VARCHAR(255),
status VARCHAR(25) default 'no');
- Create a csv with corresponding columns (you can leave some blank) and follow these steps to import it into your db.
- Before you use LS for the first time, you'll need to run
npm installto download and install your files.
node app.js -s [Email Subject] -f [HTML Content] -a <attachments>
###Example:
node app.js -s "Please read my email" -f awesome.html -a joy.jpg,monkey.jpg
###Important notes
- A subject line is required
- The html file is required
- Multiple attachments must be separated by a comma (not spaces and not comma space)
- Attachments are automatically given cid tags without their extension, so you can add as many as you'd like and have corresponding cids for the ones you want to use.
In your HTML file, you can use the following tokens and they will be replaced with text from your database: {{name}}, {{last name}}, {{bldg}}, {{dept}}. If you look at the code, you can see that adding or changing tokens should be straightforward.
If you have a script to personalize an attachment, such as an image, you can execute this script out of LoveableSpammer using the -h option and it will pass in first name and last name as command line arguments and take the results of the script as the attachment filename.
Example:
node app.js -s "Please read my email" -f awesome.html -a joy.jpg,monkey.jpg -h webdr.sh
* -s, --subject ["subject line"]'
* -f, --file <path>
* -m, --from <sender>: Must be in the format "First Last <firstlast@domain.com>"
* -a, --attach <items>, 'Attachments'
* -t, --to <recips>, 'Recipients'
* -h, --hook <hook>, 'External application to generate dynamic content'