class WcoEmail::Campaign

#
# vp 2023-02-02
# Sends a campaign.
#

def self.list

def self.list
  [[nil,nil]] + all.map { |p| [ p.slug, p.id ] }
end

def do_send

def do_send
  leads.each do |lead|
    ctx = Ctx.create!({
      email_template: tmpl,
      from_email:     tmpl.from_email,
      lead_id:        lead.id,
      send_at:        Time.now,
      subject:        tmpl.subject,
    })
  end
end

def tmpl; email_template; end

def tmpl; email_template; end