Sha256: 0f6141964ee6fdb0dd2493554c286c0a29ddf2f2d0f0bdf677d290106eb901ed

Contents?: true

Size: 848 Bytes

Versions: 1

Compression:

Stored size: 848 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 = notification.subject.to_s
    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

1 entries across 1 versions & 1 rubygems

Version Path
mailboxer-0.4.3 app/mailers/notification_mailer.rb