GithubHelp home page GithubHelp logo

abways / mass-email Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yzguy/mass-email

0.0 0.0 0.0 30 KB

python script to send out mass emails with small differences using csv file and markdown template

Python 100.00%

mass-email's Introduction

Mass-Email

Have you ever wanted to send out essentially the same email out to a bunch of people, but changing a little information? Well, with Mass-Email you can do that.

All you need to do is provide a CSV file with the different information, and a Markdown template referencing the columns in the CSV file.

When you are done, you can just run the python script and enter your google email account information, and the subject of the email.

Prerequisites

  • jinja2 (pip install jinja2)
  • markdown (pip install markdown)

CSV File Syntax

The first row of the CSV file will be the variable name for the different information between emails.

name,email,company,promocode

After this, each row will be the information per contact.

name email company promocode
Adam Smith [email protected] Yzguy 12345
Marky Mark [email protected] Mark Co

You do not need to have every column for each contact, but if you don't you must handle that in your Markdown template with an if statement. This will be shown later (Notice Marky Mark does not have a promo code).

Markdown File Syntax

The Markdown file uses existing Markdown Syntax (https://help.github.com/articles/markdown-basics), but now you will be able to use Jinja2 templating syntax to add in your per-contact information.

Yzguy Product Promo
===================

Hello {{ name }},

We would like to thank you and {{ company }} for continued loyalty.

{% if promocode %}
For being a long time customer, here is a promo code for a free product:  
    * Promo Code: {{ promocode }}  
{% endif %}

Thank you,
   Adam

Notice the if statement to handle there being a promo code or not, this is how you should handle fields that are not present for all contacts.

Script Execution

Executing the script is pretty straight forward, you only need to pass in two arguments, these being a path to Markdown file, and the CSV file.

ex. ./mass-email.py --markdown ~/loyaltytemplate.md --csv ~/loyaltydata.csv

You may enter verbose as the third argument to output the raw emails after they are sent.
After that, you will need to enter your Google Email credentials (they are not stored), and a Subject for the emails.

root@host: ~$ ./mass-email.py --markdown example-template.md --csv example-data.csv 
Username: [email protected]
Password: 
Subject: Yzguy Product Promo    
Email sent to: [email protected]
Email sent to: [email protected]

Total Emails Sent: 2

mass-email's People

Contributors

yzguy 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.