At The Children’s Campaign, we are using a program called Mailgun to send out massive amounts of emails using an API. During the sending process, we assign four separate tags to the emails: LrgEm##, LrgEm##a, LrgEm##b, and LrgEm##c. About a week after we send out these emails through the API, we download all of the 500k logs of events that the email has accumulate (opened, clicked, etc.). Previously we had to consolidate all four tags manually and write excel formulas to do calculations on them, among other steps. It was a sort of tedious process. I thought that we could save time by automating the entire process, so I created this first file (logs.py). It consolidates all of the tags and programmatically adds data into the cells that used to require manual entry of excel formulas. It also uses user entry to name the excel file. All the user has to enter is the tag, type, and date the email was sent out. The program also displays details to the user during runtime.
logs.py
The second file gets detailed statistics for an email the user specifies, and all the user has to enter is the first tag: LrgEm92.
statistics.py
The third gets a record of the permanent failures so that they can be deleted from the messaging lists. These include permanent bounces, unsubscribes, and permanent complaints. Three excel files are created for the lists. These are important because they can later be uploaded in order to delete these contacts from the email lists.
failures.py
View the code for these python files on GitHub.
I also updated a program written in C# from a previous intern, it uses Windows Forms and provides a graphical interface for users to send out emails with. The problem with this program at the time was that it could not schedule emails for delivery, it sent them out immediately when the user pressed send. I used C# to convert a user-specified date and time into a date that was RFC2822 compatible. The user also can select whether or not they would like to schedule the email.