Modular mass emailing with Microsoft Outlook
Find a file
2023-07-24 08:16:46 +01:00
Category 1.txt Initial Commit 2023-05-06 07:11:23 +01:00
Category 2.txt Initial Commit 2023-05-06 07:11:23 +01:00
Email Introduction.txt Initial Commit 2023-05-06 07:11:23 +01:00
Email Signature.txt Initial Commit 2023-05-06 07:11:23 +01:00
Email Style.txt Initial Commit 2023-05-06 07:11:23 +01:00
emailer.py Initial Commit 2023-05-06 07:11:23 +01:00
README.md Update README.md 2023-07-24 08:16:46 +01:00
recipients.csv Update recipients.csv 2023-05-06 07:50:18 +01:00

About

This is a Python script that allows the modular construction and sending of emails.

The construction of the email can be broken down into mutliple parts. Conditional statements allow for adaptive control of the content based on the category of recipient.

Email recipients are retrieved from recipients.csv, a csv file that takes category, name, and email.
All fields are required. Any row without a name or valid email will be removed to avoid errors at run time. Rows with duplicate emails are also removed.

An email is then constructed for each of the recipients.
The body of the email consists of the Email Style, Email Introduction, Email Details, and Email Signature.
The middle section of the email - Email Details - is determined based on the category of the recipient. A category of 1 sets this to the text present in Category 1.txt and a category of 2 sets this to the text present in Category 2.txt.

Optionality can be increased by increasing the number of categories. It is also possible to adapt such that more than Email Details is conditional, increasing versatility.

The number of recipients to send to can be altered when calling the mass_email() function by changing the batch_size argument. By default, this is set to batch_size=500. This means that a maximum of 500 emails will be sent out at one time, with fewer being sent if the ending is reached prematurely. There is also an argument for the last email sent, last_email. This allows for continuation from the previous batch. By default, this is set to last_email=None and results in starting from the beginning.