Skip to content

Instantly share code, notes, and snippets.

@brennandunn
Created July 1, 2012 13:15
Show Gist options
  • Save brennandunn/3028397 to your computer and use it in GitHub Desktop.
Save brennandunn/3028397 to your computer and use it in GitHub Desktop.
Prototype of a drip marketing library
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
@brennandunn
Copy link
Author

After creating a user, simply invoke: UserDrip.schedule(current_user)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment