Sha256: 6744fb30ca78023a546ae8bc61ea356989acc7be7f1d8df82358b25bdf2b1fe8

Contents?: true

Size: 629 Bytes

Versions: 10

Compression:

Stored size: 629 Bytes

Contents

module Thredded
  class PostMailer < ActionMailer::Base
    def at_notification(post_id, user_emails)
      @post = Post.find(post_id)

      headers['X-SMTPAPI'] = %Q{{"category": ["thredded_#{@post.messageboard.name}","at_notification"]}}
      mail from: no_reply,
        to: no_reply,
        bcc: user_emails,
        reply_to: reply_to,
        subject: subject
    end

    private

    def subject
      "#{Thredded.email_outgoing_prefix} #{@post.topic.title}"
    end

    def reply_to
      "#{@post.topic.hash_id}@#{Thredded.email_incoming_host}"
    end

    def no_reply
      Thredded.email_from
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
thredded-0.0.12 app/mailers/thredded/post_mailer.rb
thredded-0.0.10 app/mailers/thredded/post_mailer.rb
thredded-0.0.9 app/mailers/thredded/post_mailer.rb
thredded-0.0.8 app/mailers/thredded/post_mailer.rb
thredded-0.0.7 app/mailers/thredded/post_mailer.rb
thredded-0.0.6 app/mailers/thredded/post_mailer.rb
thredded-0.0.5 app/mailers/thredded/post_mailer.rb
thredded-0.0.4 app/mailers/thredded/post_mailer.rb
thredded-0.0.3 app/mailers/thredded/post_mailer.rb
thredded-0.0.1 app/mailers/thredded/post_mailer.rb