Sha256: 732a34f3b484a8d9c42c5bbcc23ce6c88ffcd3d98d75f42fb878920b3aef0989

Contents?: true

Size: 1.29 KB

Versions: 4

Compression:

Stored size: 1.29 KB

Contents

#OVERRING WARNING
#We must override the NotificationMailer from Mailboxer to change the new_notification_email method
#refer to it for more info
#NOTE: There is just few lines different from original Mailboxer NotificationMailer. Please maintain it
#updated for correct behaviour
class NotificationMailer < ActionMailer::Base
  default :from => Mailboxer.default_from
  #Sends and email for indicating a new notification to a receiver.
  #It calls new_notification_email.
  def send_email(notification,receiver)
    new_notification_email(notification,receiver)
  end

  include ActionView::Helpers::SanitizeHelper
  include Mailboxer::NotificationDecoder

  #Sends an email for indicating a new message for the receiver
  def new_notification_email(notification,receiver)
    @notification = notification
    @receiver = receiver
    #DIFFERENT FROM ORIGINAL----------------------
    subject = notification.subject.to_s
    #subject = notifications.subject_decoded
    #END OF DIFFERENCE----------------------------
    subject = strip_tags(subject) unless subject.html_safe?
    mail(:to => receiver.send(Mailboxer.email_method), :subject => t('mailboxer.notification_mailer.subject', :subject => subject)) do |format|
      format.text {render __method__}
      format.html {render __method__}
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
social_stream-base-0.7.8 app/mailers/notification_mailer.rb
social_stream-base-0.7.7 app/mailers/notification_mailer.rb
social_stream-base-0.7.6 app/mailers/notification_mailer.rb
social_stream-base-0.7.5 app/mailers/notification_mailer.rb