Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 months ago
JSON representation
Ruby lib and cli to send erb emails to people in a CSV
- Host: GitHub
- URL: https://github.com/sunny/wubmail
- Owner: sunny
- Created: 2008-03-12T17:26:36.000Z (almost 17 years ago)
- Default Branch: main
- Last Pushed: 2021-04-29T07:41:46.000Z (over 3 years ago)
- Last Synced: 2024-03-14T23:07:21.674Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
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
jack@example.com,Jack,male
gwen@example.com,Gwen,female
ianto@example.com,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
naps@example.com,18
srzt@example.com,16
phil@example.com,16
webs@example.com,18,PS: Don't be late this time!
gamo@example.com,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.0Hello,
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 .