Sha256: 51d42c7f6b95c23ffd3395e8e506e71e687c1011a0aeae90541fd69210fbbaf2

Contents?: true

Size: 850 Bytes

Versions: 27

Compression:

Stored size: 850 Bytes

Contents

module Locomotive
  class Notifications < ActionMailer::Base

    default from: Locomotive.config.mailer_sender

    def new_content_entry(account, entry)
      @site, @account = entry.site, account
      @entry, @type   = entry, entry.content_type

      @domain = entry.site.domains.first ||
        ActionMailer::Base.default_url_options[:host] ||
        'localhost'

      subject = new_content_entry_subject(entry, domain: @domain, type: @type.name, locale: account.locale)

      mail subject: subject, to: account.email
    end

    protected

    def new_content_entry_subject(entry, options)
      if entry.content_type.public_submission_title_template.blank?
        t('locomotive.notifications.new_content_entry.subject', options)
      else
        entry.content_type.public_submission_title(entry, options)
      end
    end

  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
locomotivecms-4.0.0.alpha3 app/mailers/locomotive/notifications.rb
locomotivecms-3.4.1 app/mailers/locomotive/notifications.rb
locomotivecms-4.0.0.alpha2 app/mailers/locomotive/notifications.rb
locomotivecms-4.0.0.alpha1 app/mailers/locomotive/notifications.rb
locomotivecms-3.4.0 app/mailers/locomotive/notifications.rb
locomotivecms-3.3.0 app/mailers/locomotive/notifications.rb
locomotivecms-3.3.0.rc3 app/mailers/locomotive/notifications.rb
locomotivecms-3.3.0.rc2 app/mailers/locomotive/notifications.rb
locomotivecms-3.1.2 app/mailers/locomotive/notifications.rb
locomotivecms-3.2.1 app/mailers/locomotive/notifications.rb
locomotivecms-3.3.0.rc1 app/mailers/locomotive/notifications.rb
locomotivecms-3.2.0 app/mailers/locomotive/notifications.rb
locomotivecms-3.2.0.rc2 app/mailers/locomotive/notifications.rb
locomotivecms-3.2.0.rc1 app/mailers/locomotive/notifications.rb
locomotivecms-3.1.1 app/mailers/locomotive/notifications.rb
locomotivecms-3.1.0 app/mailers/locomotive/notifications.rb
locomotivecms-3.1.0.rc3 app/mailers/locomotive/notifications.rb
locomotivecms-3.1.0.rc2 app/mailers/locomotive/notifications.rb
locomotivecms-3.1.0.rc1 app/mailers/locomotive/notifications.rb
locomotivecms-3.0.1 app/mailers/locomotive/notifications.rb