Class: Proclaim::SubscriptionMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/proclaim/subscription_mailer.rb

Instance Method Summary collapse

Instance Method Details

#new_comment_notification_emailObject



15
16
17
18
19
20
21
22
23
24
25
# File 'app/mailers/proclaim/subscription_mailer.rb', line 15

def new_comment_notification_email
  @comment = Comment.find(params[:comment_id])

  message = Premailer.new(render_to_string, with_html_string: true, base_url: root_url)

  mail to: @subscription.email,
    subject: "New Comment On \"#{@comment.post.title}\"" do |format|
      format.html { message.to_inline_css }
      format.text { message.to_plain_text }
  end
end

#new_post_notification_emailObject



27
28
29
30
31
32
33
34
35
36
37
# File 'app/mailers/proclaim/subscription_mailer.rb', line 27

def new_post_notification_email
  @post = Post.find(params[:post_id])

  message = Premailer.new(render_to_string, with_html_string: true, base_url: root_url)

  mail to: @subscription.email,
    subject: "New Post: #{@post.title}" do |format|
      format.html { message.to_inline_css }
      format.text { message.to_plain_text }
  end
end

#welcome_emailObject



5
6
7
8
9
10
11
12
13
# File 'app/mailers/proclaim/subscription_mailer.rb', line 5

def welcome_email
  message = Premailer.new(render_to_string, with_html_string: true, base_url: root_url)
  base_url = root_url.gsub(/\A.*:\/\//, '').gsub(/\A(.*?)\/*\z/, '\1')

  mail to: @subscription.email, subject: "Welcome to #{base_url}!" do |format|
    format.html { message.to_inline_css }
    format.text { message.to_plain_text }
  end
end