Short description and motivation.
To define a drip, create a subclass of Drippings::ProcessJob
which implements process
. For example:
class LeadFollowupJob < Drippings::ProcessJob
# @param lead [Lead] the lead to email
def process(lead)
MessageSenderService.send(body: 'Hello, buy my product!', lead: lead)
end
end
To define the schedule on which you want your drips to process, register a drip by defining a drip name, process job, and scope:
# config/initializers/drippings.rb
Drippings.configure do |config|
config.register("Lead::Followup", LeadFollowupJob, -> { Lead.active })
end
Add this line to your application's Gemfile:
gem 'drippings'
And then execute:
$ bundle
Or install it yourself as:
$ gem install drippings
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.