Send email to asciicast author when someone comments
parent
0bb3e75fb6
commit
3a7f462b13
@ -0,0 +1,13 @@
|
||||
class UserMailer < ActionMailer::Base
|
||||
default from: "hello@ascii.io"
|
||||
|
||||
def new_comment_email(user, comment)
|
||||
@comment = comment
|
||||
@author = comment.user
|
||||
@asciicast = AsciicastDecorator.new(@comment.asciicast)
|
||||
|
||||
to = "~#{user.nickname} <#{user.email}>"
|
||||
subject = %(New comment for #{@asciicast.smart_title})
|
||||
mail :to => to, :subject => subject
|
||||
end
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
Howdy!
|
||||
|
||||
~<%= @author.nickname %> (<%= profile_url(@author) %>) commented on your asciicast "<%= @asciicast.smart_title %>":
|
||||
|
||||
<%= @comment.body %>
|
||||
|
||||
---
|
||||
http://ascii.io/
|
@ -0,0 +1,5 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe UserMailer do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in New Issue