Just came across the refuel! method and I think offset: :current might be a safer default than :created_at.
Otherwise if I'm understanding correctly, new drips will be sent simultaneously on all old subscriptions that are being refueled.
I'm thinking you would only want that behavior if you're only adding 1 new drip (so the 1 drip is sent immediately) or if you've added drips to new subscriptions that are within the delay period.
|
# Add (new) drips to a `CampaignSubscriber`. |
|
# |
|
# Useful if you added new drips to a `Campaign` and have existing `CampaignSubscription` |
|
# which you want to add them to. |
|
# |
|
# Pass `:created_at` if you want to offset `Mailing#send_at` time from the time the `CampaignSubscription` |
|
# was originally created. That is to say that if you add a new drip for 5 days from now, the mailing will be sent |
|
# 5 days from when the `CampaignSubscription` was created. |
|
# |
|
# Pass `:current` to offset from the current time (doesn't offset anything, actually) |
|
def refuel!(offset: :created_at) |
|
::CampaignSubscriptions::RefuelService.new(self, offset: offset).call |
|
|
|
true |
|
end |
Just came across the
refuel!method and I thinkoffset: :currentmight be a safer default than:created_at.Otherwise if I'm understanding correctly, new drips will be sent simultaneously on all old subscriptions that are being refueled.
I'm thinking you would only want that behavior if you're only adding 1 new drip (so the 1 drip is sent immediately) or if you've added drips to new subscriptions that are within the delay period.
caffeinate/app/models/caffeinate/campaign_subscription.rb
Lines 64 to 78 in 93c8fe5