Sha256: a3eb3152f6a0843a10bd92f0d5875041dc607ab1d1a04d4f230826d7330e3c61

Contents?: true

Size: 1.12 KB

Versions: 107

Compression:

Stored size: 1.12 KB

Contents

class Notifier < ActionMailer::Base
  if LibraryGroup.site_config.try(:url)
    uri = Addressable::URI.parse(LibraryGroup.site_config.url)
    default_url_options[:host] = uri.host
    default_url_options[:port] = uri.port if configatron.enju.web_port_number != 80
  else
    default_url_options[:host] = configatron.enju.web_hostname
    default_url_options[:port] = configatron.enju.web_port_number if configatron.enju.web_port_number != 80
  end

  def message_notification(message)
    I18n.locale = message.receiver.locale.to_sym
    from = "#{LibraryGroup.system_name(message.receiver.locale)} <#{LibraryGroup.site_config.email}>"
    if message.subject
      subject = message.subject
    else
      subject = I18n.t('message.new_message_from_library', :library => LibraryGroup.system_name(message.receiver.user.locale))
    end
    if message.sender
      @sender_name = message.sender.patron.full_name
    else
      @sender_name = LibraryGroup.system_name(message.receiver.locale)
    end
    @message = message
    @locale = message.receiver.locale
    mail(:from => from, :to => message.receiver.email, :subject => subject)
  end
end

Version data entries

107 entries across 107 versions & 2 rubygems

Version Path
enju_event-0.1.16 spec/dummy/app/mailers/notifier.rb
enju_event-0.1.15 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.71 spec/dummy/app/mailers/notifier.rb
enju_event-0.1.13 spec/dummy/app/mailers/notifier.rb
enju_event-0.0.27 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.70 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.69 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.68 spec/dummy/app/mailers/notifier.rb
enju_event-0.0.26 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.67 spec/dummy/app/mailers/notifier.rb
enju_event-0.0.25 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.66 spec/dummy/app/mailers/notifier.rb
enju_event-0.1.12 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.65 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.64 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.63 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.62 spec/dummy/app/mailers/notifier.rb
enju_event-0.1.11 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.61 spec/dummy/app/mailers/notifier.rb
enju_circulation-0.0.60 spec/dummy/app/mailers/notifier.rb