Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/igorrendulic/mailgun-csv-bulk-send
Command line Custom Email Template Sending with Mailgun from CSV file with Mustache
https://github.com/igorrendulic/mailgun-csv-bulk-send
cli csv email-marketing email-sender mailgun mailgun-api mustache
Last synced: 20 days ago
JSON representation
Command line Custom Email Template Sending with Mailgun from CSV file with Mustache
- Host: GitHub
- URL: https://github.com/igorrendulic/mailgun-csv-bulk-send
- Owner: igorrendulic
- Created: 2018-11-25T19:08:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-23T18:11:06.000Z (almost 4 years ago)
- Last Synced: 2024-11-14T01:33:42.398Z (3 months ago)
- Topics: cli, csv, email-marketing, email-sender, mailgun, mailgun-api, mustache
- Language: Go
- Homepage: https://mail.io
- Size: 304 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Command line Personalized Email Sending with Mailgun from CSV file
![alt text](https://raw.githubusercontent.com/igorrendulic/mailgun-csv-bulk-send/master/docs/mailgun-bulk.png)
This simple program can handle CSV files for personalized email sending using [Mailgun API](https://www.mailgun.com). It uses [template language Mustache](http://mustache.github.io/mustache.5.html) for both HTML and Plain text templates.
The reason for this command line interface is fast preparation of Email Template Contents with exported CSV list.
# Sending email via Command Line tool
Edit the config file under `data/config.json`, prepare `domain name and api key from Mailgun`, change `subject` and `from`.
```
{
"domain_name": "domainname",
"api_key": "appkey",
"subject": "this is my subject",
"from": "mymail ",
"html_template":"templates/simple-template.html",
"text_template":"templates/simple-template.txt",
"test":true
}
```Modify Exampl Excel file under `data/example.csv`.
- **CSV file must have headers as first line**
- **There must be at least 1 field named: `email` in the headers**
- **Other header names are used as Mustache placeholders in the template**```
email,name,date
[email protected],igor,3/12/18
[email protected],Ashley,3/12/18
[email protected],igor2,3/12/18
```Run:
```
go run main.go send -c data/config.json -s data/example.csv
```-c is a path to config.json file
-s is path to CSV file
# Customizing template
Templates are stored under folder `templates/...`
Template customization is based on Mustache templating language. [You can read more about how to customize templates here](http://mustache.github.io/mustache.5.html).
Plain/Text template example
```
Hi {{name}},Sometimes you just want to send a simple HTML email with a simple design and clear call to action. This is it.
This is a really simple email template. Its sole purpose is to get the recipient to click the button with no distractions.
Good luck! The date is {{date}}.
```# Libraries
[Mustache](https://github.com/hoisie/mustache) - This one was taken from this project (dep pointed to older version)
[Mailgun](https://github.com/mailgun/mailgun-go)
[Cobra](github.com/spf13/cobra)