Sha256: d599e44957c8197f5a95ebb5fd90eed30b2b6210d266ef68decb941cc4d14925

Contents?: true

Size: 728 Bytes

Versions: 9

Compression:

Stored size: 728 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
    mail(:to => receiver.email, :subject => "You have a new notification: " + strip_tags(notification.subject)) do |format|
      format.html {render __method__}
      format.text {render __method__}
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mailboxer-0.2.3 app/mailers/notification_mailer.rb
mailboxer-0.2.2 app/mailers/notification_mailer.rb
mailboxer-0.2.1 app/mailers/notification_mailer.rb
mailboxer-0.2.0 app/mailers/notification_mailer.rb
mailboxer-0.1.4 app/mailers/notification_mailer.rb
mailboxer-0.1.3 app/mailers/notification_mailer.rb
mailboxer-0.1.2 app/mailers/notification_mailer.rb
mailboxer-0.1.1 app/mailers/notification_mailer.rb
mailboxer-0.1.0 app/mailers/notification_mailer.rb