Sha256: 91507fa9758a38a0c354fe0bbb25b610e55fb0d05e53bcba5e0b4f64af6c2f7c
Contents?: true
Size: 1.46 KB
Versions: 56
Compression:
Stored size: 1.46 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 #DIFFERENT FROM ORIGINAL---------------------- include Mailboxer::NotificationDecoder #END OF DIFFERENCE---------------------------- #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 = decode_basic_notification(subject,notification.notified_object) subject = subject.gsub(/\n/,'') #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
56 entries across 56 versions & 2 rubygems