Sha256: a142a974a717e2c67f65b5c710238510688a1c8e7d132b0d3de36a2b8e8cf2cd

Contents?: true

Size: 1.25 KB

Versions: 36

Compression:

Stored size: 1.25 KB

Contents

class Notifier < ActionMailer::Base
  def message_notification(message_id)
    message = Message.find(message_id)
    I18n.locale = message.receiver.profile.locale.try(:to_sym) || I18n.default_locale
    from = "#{LibraryGroup.system_name(message.receiver.profile.locale)} <#{LibraryGroup.site_config.user.email}>"
    if message.subject
      subject = message.subject
    else
      subject = I18n.t('message.new_message_from_library', library: LibraryGroup.system_name(message.receiver.user.profile.locale))
    end
    if message.sender
      @sender_name = message.sender.username
    else
      @sender_name = LibraryGroup.system_name(message.receiver.profile.locale)
    end
    @message = message
    @locale = message.receiver.profile.locale
    mail(from: from, to: message.receiver.email, subject: subject)
  end

  def manifestation_info(user_id, manifestation_id)
    user = User.find(user_id)
    manifestation = Manifestation.find(manifestation_id)
    from = "#{LibraryGroup.system_name(user.profile.locale)} <#{LibraryGroup.site_config.user.email}>"
    subject = "#{manifestation.original_title} : #{LibraryGroup.system_name(user.profile.locale)}"
    @user = user
    @manifestation = manifestation
    mail(from: from, to: user.email, subject: subject)
  end
end

Version data entries

36 entries across 34 versions & 2 rubygems

Version Path
enju_library-0.3.11 app/mailers/notifier.rb
enju_library-0.3.10 app/mailers/notifier.rb
enju_library-0.3.9 app/mailers/notifier.rb
enju_library-0.3.8 app/mailers/notifier.rb
enju_library-0.3.8.rc.2 app/mailers/notifier.rb
enju_library-0.3.8.rc.1 app/mailers/notifier.rb
enju_library-0.3.7 app/mailers/notifier.rb
enju_library-0.3.6 app/mailers/notifier.rb
enju_library-0.4.0.beta.4 app/mailers/notifier.rb
enju_library-0.4.0.beta.3 app/mailers/notifier.rb
enju_library-0.4.0.beta.2 app/mailers/notifier.rb
enju_library-0.4.0.beta.1 app/mailers/notifier.rb
enju_library-0.3.5 app/mailers/notifier.rb
enju_library-0.3.4 app/mailers/notifier.rb
enju_library-0.3.3 app/mailers/notifier.rb
enju_library-0.3.2 app/mailers/notifier.rb
enju_library-0.3.1 app/mailers/notifier.rb
enju_library-0.3.0 app/mailers/notifier.rb
enju_library-0.3.0.rc.1 app/mailers/notifier.rb
enju_library-0.3.0.beta.2 app/mailers/notifier.rb