Class: Moist::CampaignSubscriber

Inherits:
ApplicationRecord show all
Includes:
Models::CampaignSubscriber
Defined in:
app/models/moist/campaign_subscriber.rb

Instance Method Summary collapse

Methods included from Models::CampaignSubscriber

#current_step, included, #mail!, #next_mailing, #next_step, #next_step?, #ready_for_next_mailing?

Instance Method Details

#create_mailings!Object



17
18
19
20
21
# File 'app/models/moist/campaign_subscriber.rb', line 17

def create_mailings!
  moist_campaign.steps.each do |step|
    ::Moist::Mailing.create!(moist_campaign_subscriber: self, send_at: step.options[:delay].from_now, mailer_class: step.mailer_class, mailer_action: step.mailer_action)
  end
end