Whotowho
Get Version
0.2.0→ ‘How to assign one person to another’
What
WhoToWho is a simple script to find a random name in a list and send this name by email. With WhoToWho you can define several things:
- Email subject
- Email contents with 2 parameters (who and towho)
- SMTP configuration
- SSL option if your SMTP connection is a Gmail account
History
WhoToWho was first made for my group of friends. For Christmas, we decided to group up and each of us offer one present to one other person. The present’s price is defined at the start.
Before WhoToWho, we made a group before Christmas Eve and made the random choice with a little paper in hat.
Now we live in different places and we can’t see each other every week. So, as we all have an email account, I created WhoToWho. This way nobody knows who must give a present to whom and the choice is totally random.
Yes, WhoToWho is useless. But what is really useful anyway?
Features
- Randomly pick a person for every person
- Send an email to every person to know to whom he or she is assigned
- Define the subject and the contents of the email with 2 parameters (who and to who)
- You may exclude one or several persons for anybody in the list. With this feature, one can’t randomly be assigned to another person.
Installing
sudo gem install whotowho
Requirements
- ActionMailer from the Ruby On Rails project:
gem install actionmailer
Example
ruby whotowho -m mail-example.txt -s 'A good subject' -f ../data.yaml -c conf.yaml -g
Example data file
This file defines the list of names and emails. This file is in YAML and is the serialization of an Array of an Array in Ruby. Here is an example:
- - name - email - - name2 - email2 - - name3 - email3If you want to exclude a person to another you need add an
:exclude:
list of names after the email, like the following:
- - name - email - :exclude: - name2 - - name2 - email2 - :exclude: - name5 - name6 - - name3 - email3 - - name4 - email4 - - name5 - email5 - - name6 - email6
Example email configuration file
It’s the same as ActionMailer’s. However I added the ability to add the “From”
field, which you can add using the symbol :from:.
:address:: Allows you to use a remote mail server. Just change it from its default “localhost” setting.:port:: On the off chance that your mail server doesnât run on port 25, you can change it.:domain:: If you need to specify a HELO domain, you can do it here.:user_name:: If your mail server requires authentication, set the username in this setting.:password:: If your mail server requires authentication, set the password in this setting.:authentication:: If your mail server requires authentication, you need to specify the authentication type here. This is a symbol and one of :plain, :login, :cram_md5:from:: Define the email who send all mail in from header
Example of email content file
This file is a simple text file. You have two parameters which are changed before the email is sent:
#{who}: the name of person who receives the email#{towho}: the name of the assigned person
How to submit patches
The trunk repository is http://whotowho.rubyforge.org/svn/trunk
for anonymous access. You can submit a patch on
RubyForge or on my own
development platform.
Rdoc
You can consult the Rdoc of this project on the WhoToWho RDoc page.
Thanks
Special thanks to Sunny for his translation in good english of this page.
License
This code is free to use under the terms of the MIT license.
Contact
Comments are welcome. Send an email to Cyril Mougel
Cyril Mougel, 6th January 2008
Theme extended from Paul Battley