Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sunny/wubmail

Ruby lib and cli to send erb emails to people in a CSV
https://github.com/sunny/wubmail

Last synced: about 15 hours ago
JSON representation

Ruby lib and cli to send erb emails to people in a CSV

Awesome Lists containing this project

README

        

WubMail
=======

WubMail is a small command line tool to send emails to using a template and a list of emails.

Install
-------

```sh
$ gem install wubmail
```

Example
-------

users.txt:

```csv
email,name,sex
[email protected],Jack,male
[email protected],Gwen,female
[email protected],Ianto,male
```

welcome.txt:

```erb
From: Sunny
To: <%= name %> <<%= email %>>
Subject: Hello <%= name %>!

Hello <%= name %>,
You are one hell of a cute <%= sex == "female" ? "girl" : "boy" %>!
```

Then type in a terminal:

```sh
$ wubmail welcome.txt users.csv
```

And it will print out an example. Send it to everybody by adding the `-s` argument. That's it!

Answers
-------

### How do I add variables in the message?

Just create new columns in your csv. You may use any column name you want as long as it can be a Ruby variable name.

### What can I put in my email?

The message is parsed using erb, which means you can put any amount of Ruby you'd like in it, between `<%` and `%>`.

### How do I add headers?

Just add lines under From, To and Subject.

Another example
---------------

friends.csv:

```csv
email,arrival_time,ps
[email protected],18
[email protected],16
[email protected],16
[email protected],18,PS: Don't be late this time!
[email protected],18,PS: Don't forget to bring one of your favorite recipes.
```

party-email.txt.erb:

```erb
From: Sunny
To: <%= email %>
Subject: Great Party
X-Mailer: Wubmail/1.0

Hello,
Just a quick note to tell you that for the great party
you should arrive at <%= arrival_time %> o'clock.

Thanks,
Sunny

<%= ps %>
```

Credits
-------

By Sunny Ripert , under the WTFPL .