Sha256: 4a9618e36d8afb1ca6e2bc24073c259b5b19e257d40b6d55672fda402a71350c

Contents?: true

Size: 1.23 KB

Versions: 41

Compression:

Stored size: 1.23 KB

Contents

module IshManager
  class ApplicationMailer < ActionMailer::Base
    default from: 'WasyaCo Consulting <no-reply@wco.com.de>'
    helper(IshManager::ApplicationHelper)

    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

41 entries across 41 versions & 1 rubygems

Version Path
ish_manager-0.1.8.491 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.490 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.489 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.488 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.487 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.486 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.485 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.484 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.483 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.482 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.481 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.480 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.479 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.478 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.477 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.476 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.475 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.474 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.473 app/mailers/ish_manager/application_mailer.rb
ish_manager-0.1.8.472 app/mailers/ish_manager/application_mailer.rb