Class: Proclaim::SubscriptionMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/proclaim/subscription_mailer.rb

Instance Method Summary collapse

Instance Method Details

#new_comment_notification_email(subscription, comment) ⇒ Object



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

def new_comment_notification_email(subscription, comment)
  @subscription = subscription
  @comment = comment

  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_email(subscription, post) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/mailers/proclaim/subscription_mailer.rb', line 30

def new_post_notification_email(subscription, post)
  @subscription = subscription
  @post = post

  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_email(subscription) ⇒ Object



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

def welcome_email(subscription)
  @subscription = subscription

  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