sell digital products and send drip emails

Boutique is a Sinatra app for selling digital products and sending drip emails.
See Boutique on GitHub (still in development!)


$ gem install boutique

Install as a rubygem via gem install scron. Then configure cron to run it every 2 hours.


require 'boutique'

Boutique.configure do |c|
  c.error_email    ''
  c.stripe_api_key 'sk_test_abcdefghijklmnopqrstuvwxyz'
  c.download_dir   '/path/to/download'
  c.download_path  '/download'
    adapter: 'postgres',
    host: 'localhost',
    username: 'root',
    password: 'secret',
    database: 'boutique')
    via: :smtp,
    via_options: {host: ''})

Boutique.list('learn-ruby') do |l|
  l.from   'Hugh '
  l.emails '/path/to/emails-dir'
  l.url    ''

run Boutique::App if !ENV['BOUTIQUE_CMD']

Like other rack apps, setup a file to use Boutique. Here, you'll configure emails, API keys, and database credentials.

Database & Assets

# in .bashrc or .zshrc

$ bin/boutique --migrate
$ boutique --assets
   new -- boutique.js
   new -- boutique.css
$ mv boutique.js boutique.css /path/to/project/assets/.

Boutique comes with a command line tool for migrations and generating static assets. You'll want to serve these assets via a web server like Nginx or Apache.

Drip Emails

day: 1
subject: First Email
key: first-email


This is the first email in the series.

- Hugh

[Click here to unsubscribe.](<%= unsubscribe_url %>)

Emails can be written in any templating format that Tilt accepts. Stick them in /path/to/emails-dir (configured above in Emails use front-matter YAML for passing information to Boutique. The required fields are day, subject, and key. The day is how many days should pass until the email is sent. The key is a unique key assigned to each email to guard against sending multiples to the same recipient. You'll also have access to three local variables:

This example email should be stored in the file /path/to/emails-dir/

Boutique is released under the BSD License and developed by Hugh Bien. Follow me via @hughbien.