Uses Google Docs, Twilio, ESV Bible, and MailChimp to support our 40 Day events with daily verses and messages
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
db
.gitignore
Gemfile
LICENSE
README.md
config.rb.sample
get_oauth.rb
votd.rb

README.md

Verse of the Day

This is a tool developed for RiverRock Christian Fellowship to facilitate sending daily verses and messages. RCF does a yearly 40 Day event where this comes in handy. While this tool is a bit specialized to our needs, there were several bits I spent a good deal of time trying to workout so I decided to make the source available to others so who might want to do something similar.

I have written up more details about this tool on my blog.

This project was created to meet the need of of RCF, so it will most likely need a good deal of tweaking to be used elsewhere, but should be a good starting point.

Installation

clone this project then install the needed gems:

$ git clone https://github.com/faithhack/verse-of-the-day.git
$ cd verse-of-the-day
$ bundle install

This project makes use of APIs for Twillio ( http://twillio.com ), Google Docs, ESV Bible ( http://www.esvapi.org/ ), and MailChimp ( http://mailchimp.com )

I currently run this on a Linux desktop with Ruby 2.2 using cron to schedule the daily runs.

Google Docs Setup

You will need to set up a google developers account., create a project and a client ID for native application. You will also need to create a spreadsheet with two pages, one for messages, and one for recipients.

MailChimp Templates

This tool assumes you have created a template with replace variables in curly brackets. Once the template is complete, you need to create a campaign using that template with everything set as if you are going to send it so it can be duplicated. MailChimp campaign duplication does not duplicate the content of a campaign, so you need to include it in your template. Using a duplicated campaign saves having to build one up from scratch, but the MailChimp API makes this possible.

Content from the spreadsheet can be injected into the campaign message by using a token like {row_name}. The token would be replaced with the value from column 'row_name'. Special tokens include {ESV:verse} and {ESVF:verse} which are replaced by the plain text ESV bible text and the html formated ESV bible text, respectively. The current code base expects a pretty basic template and can not handle variables in repeating sections in the template.

Phone Number Validation

Phone numbers are validated using the global_phone gem. To get a current copy of the validation rules, global_phone.json, see the gem docs.