- https://github.com/excid3/jumpstart
- https://github.com/honeybadger-io/heya
- Follow Josh on Twitter for development updates
This creates a 4-part email series to welcome users who sign up for your Jumpstart app. The first email is sent immediately, and the following emails are sent 2 days apart.
This guide assumes you meet Jumpstart's requirements.
-
In a new terminal, run the following:
export DISABLE_SPRING=1 rails new jumpstart -d postgresql -m https://raw.githubusercontent.com/excid3/jumpstart/master/template.rb cd jumpstart bundle add heya maildown rails generate heya:install rails db:migrate rails generate heya:campaign Onboarding welcome:0 getting_started extending_jumpstart jumpstart_pro
-
Add the following to the end of
app/models/user.rb
:after_create_commit do OnboardingCampaign.add(self) end
-
Configure MailCatcher (optional):
# config/environments/development.rb Rails.application.configure do # .. # Use MailCatcher to inspect emails # http://mailcatcher.me # Usage: # gem install mailcatcher # mailcatcher # # => Starting MailCatcher # # => ==> smtp://127.0.0.1:1025 # # => ==> http://127.0.0.1:1080 config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = {host: "localhost", port: 1025} end
-
Update
Procfile.dev
:web: bundle exec rails server - worker: bundle exec sidekiq + worker: bundle exec sidekiq -q default -q heya webpack: bundle exec bin/webpack-dev-server
-
Run the servers:
mailcatcher foreman start
-
Open these tabs:
- ActionMailer Previews: http://localhost:5000/rails/mailers/
- MailCatcher: http://127.0.0.1:1080
-
Sign up for an account: http://localhost:5000/users/sign_up
You should see the welcome email in MailCatcher. To send the next 3 emails, run rails heya:scheduler
periodically (the emails are sent every 2 days by default, unless you customize it).
🎉