Sha256: 8db65e2befc50667b61b27d46b072bc6655fad52b68f1474ae6de9369045f843

Contents?: true

Size: 798 Bytes

Versions: 3

Compression:

Stored size: 798 Bytes

Contents

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

  #Sends an email for indicating a new message for the receiver
  def new_notification_email(notification,receiver)
    @notification = notification
    @receiver = receiver
    subject = message.subject.to_s
    subject = strip_tags(subject) unless subject.html_safe?
    mail(:to => receiver.email, :subject => "You have a new notification: " + subject) do |format|
      format.html {render __method__}
      format.text {render __method__}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mailboxer-0.3.0 app/mailers/notification_mailer.rb
mailboxer-0.2.5 app/mailers/notification_mailer.rb
mailboxer-0.2.4 app/mailers/notification_mailer.rb