Sha256: f9f914b7dba10e15345b68eb3bcc3f6bc71d7412a7f7a8ab0048aaeeacb99afa

Contents?: true

Size: 861 Bytes

Versions: 15

Compression:

Stored size: 861 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,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

15 entries across 15 versions & 1 rubygems

Version Path
mailboxer-0.9.0 app/mailers/notification_mailer.rb
mailboxer-0.8.0 app/mailers/notification_mailer.rb
mailboxer-0.7.0 app/mailers/notification_mailer.rb
mailboxer-0.6.5 app/mailers/notification_mailer.rb
mailboxer-0.6.4 app/mailers/notification_mailer.rb
mailboxer-0.6.3 app/mailers/notification_mailer.rb
mailboxer-0.6.2 app/mailers/notification_mailer.rb
mailboxer-0.6.1 app/mailers/notification_mailer.rb
mailboxer-0.6.0 app/mailers/notification_mailer.rb
mailboxer-0.5.5 app/mailers/notification_mailer.rb
mailboxer-0.5.4 app/mailers/notification_mailer.rb
mailboxer-0.5.3 app/mailers/notification_mailer.rb
mailboxer-0.5.2 app/mailers/notification_mailer.rb
mailboxer-0.5.1 app/mailers/notification_mailer.rb
mailboxer-0.5.0 app/mailers/notification_mailer.rb