Sha256: 85c808fa0215d1a95b63c9132de884d76ff3bcf71b92757d6b7f2ddcb51930a7

Contents?: true

Size: 763 Bytes

Versions: 6

Compression:

Stored size: 763 Bytes

Contents

class SimpleDiscussion::UserMailer < ApplicationMailer
  # You can set the default `from` address in ApplicationMailer

  helper SimpleDiscussion::ForumPostsHelper
  helper SimpleDiscussion::Engine.routes.url_helpers

  def new_thread(forum_thread, recipient)
    @forum_thread = forum_thread
    @forum_post   = forum_thread.forum_posts.first
    @recipient    = recipient

    mail(
      to: "#{@recipient.name} <#{@recipient.email}>",
      subject: @forum_thread.title
    )
  end

  def new_post(forum_post, recipient)
    @forum_post   = forum_post
    @forum_thread = forum_post.forum_thread
    @recipient    = recipient

    mail(
      to: "#{@recipient.name} <#{@recipient.email}>",
      subject: "New post in #{@forum_thread.title}"
    )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
simple_discussion-1.2.0 app/mailers/simple_discussion/user_mailer.rb
simple_discussion-1.0.1 app/mailers/simple_discussion/user_mailer.rb
simple_discussion-1.0.0 app/mailers/simple_discussion/user_mailer.rb
simple_discussion-0.9.5 app/mailers/simple_discussion/user_mailer.rb
simple_discussion-0.9.4 app/mailers/simple_discussion/user_mailer.rb
simple_discussion-0.9.3 app/mailers/simple_discussion/user_mailer.rb