Sha256: 2603792a1251dc451e575758241a5f27b2ceaf962c9ace31d5e2a9f7dcf7fd13

Contents?: true

Size: 1.19 KB

Versions: 66

Compression:

Stored size: 1.19 KB

Contents

module IshManager
  class ApplicationMailer < ActionMailer::Base
    default from: 'WasyaCo Consulting <no-reply@wasya.co>'
    layout 'mailer'

    def shared_galleries profiles, gallery
      return if profiles.count == 0
      @gallery        = gallery
      @domain         = Rails.application.config.action_mailer.default_url_options[:host]
      @galleries_path = IshManager::Engine.routes.url_helpers.galleries_path
      @gallery_path   = IshManager::Engine.routes.url_helpers.gallery_path(@gallery.slug)
      mail( :to => '314658@gmail.com',
            :bcc => profiles.map { |p| p.email },
            :subject => 'You got new shared galleries on pi manager' )
    end

    def option_alert option
      @option = option
      mail({
        :to => option.profile.email,
        :subject => "IshManager Option Alert :: #{option.ticker}",
      })
    end

    def stock_alert watch_id
      @watch = Iro::OptionWatch.find watch_id
      mail({
        to: @watch.profile.email,
        subject: "Iro Watch Alert :: #{@watch.ticker} is #{@watch.direction} #{@watch.mark}."
      })
    end

    def test_email
      mail( to: DEFAULT_RECIPIENT, subject: "Test email at #{Time.now}" )
    end

  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
ish_manager-0.1.8.469 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.468 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.467 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.466 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.465 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.464 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.463 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.462 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.461 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.460 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.459 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.458 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.457 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.456 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.455 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.454 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.453 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.452 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.451 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.450 app/mailers/ish_manager/application_mailer.rb