Giter Club home page Giter Club logo

albumcodemailer's Introduction

Album Code Mailer

This is a small utility for using AWS SES to send album codes to patrons and/or crowdfunders in templated emails.

You will need to ensure your AWS account meets the requirements to make the SendBulkTemplatedEmail api call: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html

Templating is fairly straightforward, compose your email and use the form {{code}} where you would like it to appear. Example:

Dear patron,

Thanks for the beer money, go get your dank tunes with the code {{code}} 
at totallyrealbandname.bandcamp.com/whatever...

The UploadTemplate command will want a path to an email template in both plaintext and html form.

The recipients input file expects something like what I've observed kickstarter and patreon exports to look like - a CSV with column headers on the first row and email addresses in the second column. Like:

And the codes list should be a plain text file with one code per line, like:

0123-4567
abcd-ef01
...

Once this is all set up, upload the template like so:

go run main.go UploadTemplate -n AwesomeTemplateName \
-s 'Here is your download code for some dank tunes!' \
-t /Users/morgan/code/AlbumCodeMailer/Templates/Patreon/textpart.txt \
-p /Users/morgan/code/AlbumCodeMailer/Templates/Patreon/htmlpart.html

Then you should test your template with a single address:

go run main.go TestBulkTemplatedEmail -d [email protected] \
-f [email protected] -s [email protected] -t AwesomeTemplateName

When you're ready to send the lot, do a dry run to sanity check the output. A dry run prints each address and the code that will be sent to it on one line. Ensure this looks right - valid codes, unique codes, etc.

go run main.go SendBulkTemplatedEmail -c /Path/To/List_of_codes \
-i /path/to/recipients.csv -f [email protected] -s [email protected] \
-t AwesomeTemplateName -d

If that checks out, simply run the above again without the trailing -d to begin sending emails. To avoid rate limiting, this program sends 100 emails per minute. This is very conservative, but I hacked this together in an evening and I don't feel like doing that math. If you have enough patrons or backers for this to hurt, I guess look to optimise here. Or just get your publicist to handle it. ;)

albumcodemailer's People

Watchers

Morgan MacKechnie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.