redirect_from |
---|
/docs/10-best-practices.html |
There are some things we've picked up implementing Caffeinate that we thought we could share with you and your beautiful application.
Having a separate base class was common.
class CaffeinateMailer < ApplicationMailer; end
class OnboardingMailer < CaffeinateMailer; end
This too. Removes a conditional check for the unsubscribe link.
class CaffeinateMailer < ApplicationMailer
layout 'caffeinate'
end
In the case that you wanted to move away from Caffeinate at some point, subbing out API calls is easier than a find/replace.
module Marketing
class Manager
class << self
def subscribe_to_campaign(campaign_slug:, subscriber:, user: nil, **args)
::Caffeinate::Campaign[campaign_slug].subscribe(subscriber, user: user)
end
end
end
end