Sha256: c0ec96d0ba648cfcf05cee6949a8e0ce6fc791ebd1b721ffbde07bcbec57ade2
Contents?: true
Size: 1.12 KB
Versions: 2
Compression:
Stored size: 1.12 KB
Contents
class Notifier < ActionMailer::Base include Resque::Mailer 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 else default_url_options[:host] = 'library.example.jp' default_url_options[:port] = 80 end 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.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 end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
enju_message-0.1.14.pre16 | spec/dummy/app/mailers/notifier.rb |
enju_message-0.1.14.pre15 | spec/dummy/app/mailers/notifier.rb |