Skip to content

Should refuel! default to current? #54

Description

@mnort9

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions