diff --git a/app/models/jobs/mail_comment_on_post.rb b/app/models/jobs/mail_comment_on_post.rb new file mode 100644 index 0000000000000000000000000000000000000000..a6a75a5c5c77a1d27439821e59b2e078e5bad550 --- /dev/null +++ b/app/models/jobs/mail_comment_on_post.rb @@ -0,0 +1,10 @@ +module Jobs + class MailCommentOnPost + extend ResqueJobLogging + @queue = :mail + def self.perform(recipient_id, sender_id, comment) + Notifier.comment_on_post(recipient_id, sender_id, comment).deliver + end + end +end + diff --git a/app/views/notifier/comment_on_post.html.haml b/app/views/notifier/comment_on_post.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..5f76c661bf83ef7e8459ec40aa2b2f8c17eaf802 --- /dev/null +++ b/app/views/notifier/comment_on_post.html.haml @@ -0,0 +1,13 @@ +%p + = t('notifier.hello', :name => @receiver.profile.first_name) +%p + = "#{@sender.name} (#{@sender.diaspora_handle})" + = t('.commented') + + %br + = link_to t('.sign_in'), status_message_url(@comment.post) + + %br + = t('notifier.love') + %br + = t('notifier.diaspora') diff --git a/app/views/notifier/comment_on_post.text.haml b/app/views/notifier/comment_on_post.text.haml new file mode 100644 index 0000000000000000000000000000000000000000..29375760ceb946e27e61e09e2aafe40a65fbf7e2 --- /dev/null +++ b/app/views/notifier/comment_on_post.text.haml @@ -0,0 +1,7 @@ += t('notifier.hello', :name => @receiver.profile.first_name) += "#{@sender.name} (#{@sender.diaspora_handle})" += t('notifier.comment_on_post.commented') + + += "#{t('notifier.love')} \n" += t('notifier.diaspora') diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index bbaa1f62fa4bf37966591b23b35fa443b707ffec..33f74a1233777ad357bcebcc17875225f417860f 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -92,7 +92,7 @@ describe User do it 'removes posts upon disconnecting' do user.disconnect(user2.person) user.reload - user.raw_visibNotification.notify(self, oble_posts.should_not include @status_message + user.raw_visible_posts.should_not include @status_message end it 'deletes a post if the noone links to it' do