Sha256: 5fd29f2a98a4965e6f1fddf9f5f1f92245ed1eb4c1f7529ece835e546cf47893

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

# Visit http://localhost:3000/rails/mailers

class EffectivePollsMailerPreview < ActionMailer::Preview

  def poll_upcoming_reminder
    poll_notification = build_poll_notification('The poll will start soon')
    Effective::PollsMailer.poll_upcoming_reminder(poll_notification, bccs)
  end

  def poll_start
    poll_notification = build_poll_notification('The poll has started')
    Effective::PollsMailer.poll_start(poll_notification, bccs)
  end

  def poll_reminder
    poll_notification = build_poll_notification('The poll started already and you have not participated')
    Effective::PollsMailer.poll_reminder(poll_notification, bccs)
  end

  def poll_end
    poll_notification = build_poll_notification('The poll has ended')
    Effective::PollsMailer.poll_end(poll_notification, bccs)
  end

  protected

  def bccs
    ['one@example.com', 'two@example.com', 'three@example.com', 'two-hundred-fifty@example.com']
  end

  def build_poll_notification(text)
    poll = Effective::Poll.new(start_at: Time.zone.now)
    Effective::PollNotification.new(poll: poll, body: text, subject: text)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
effective_polls-0.1.0 lib/generators/templates/effective_polls_mailer_preview.rb
effective_polls-0.0.2 lib/generators/templates/effective_polls_mailer_preview.rb