Sha256: 4a86e6c1abaa80818130a5f168842941b33cdbc38211516b5cfefdf686905ea8

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 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,notification), :subject => t('mailboxer.notification_mailer.subject', :subject => subject)) do |format|
      format.text {render __method__}
      format.html {render __method__}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
social_stream-base-0.7.10 app/mailers/notification_mailer.rb
social_stream-base-0.7.9 app/mailers/notification_mailer.rb