Created
July 1, 2012 13:15
-
-
Save brennandunn/3028397 to your computer and use it in GitHub Desktop.
Prototype of a drip marketing library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UserDrip | |
| include Dripper | |
| send_at [9, 0], local: true, on_weekends: false # 9am users local time, don't send on weekends (wait for Monday) | |
| opt_out { |user| !user.notifications? } | |
| after 5.minutes do | |
| # send getting started email | |
| end | |
| after 1.day, :unless => :linked_with_invoicing_tool? do | |
| # send email on linking with invoicing / time tracking tool | |
| end | |
| after 11.days, :unless => :subscribed? do | |
| # send trial expiring email | |
| end | |
| after 21.days, :unless => :subscribed? do | |
| # send special offer email | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After creating a user, simply invoke:
UserDrip.schedule(current_user)