Add unsubscribe link to emails and cleanup user mailer

This commit is contained in:
Maximilian Grundke
2017-09-13 14:37:10 +02:00
parent b1f790dcde
commit 85928361cb
5 changed files with 21 additions and 18 deletions

View File

@ -21,12 +21,13 @@ class UserMailer < ActionMailer::Base
mail(subject: t('mailers.user_mailer.got_new_comment.subject', commenting_user_displayname: @commenting_user_displayname), to: request_for_comment.user.email)
end
def got_new_comment_for_subscription(comment, request_for_comment, from_user, to_user)
@receiver_displayname = to_user.displayname
def got_new_comment_for_subscription(comment, subscription, from_user)
@receiver_displayname = subscription.user.displayname
@author_displayname = from_user.displayname
@comment_text = comment.text
@rfc_link = request_for_comment_url(request_for_comment)
mail(subject: t('mailers.user_mailer.got_new_comment_for_subscription.subject', author_displayname: @author_displayname), to: to_user.email)
@rfc_link = request_for_comment_url(subscription.request_for_comment)
@unsubscribe_link = unsubscribe_subscription_url(subscription)
mail(subject: t('mailers.user_mailer.got_new_comment_for_subscription.subject', author_displayname: @author_displayname), to: subscription.user.email)
end
def send_thank_you_note(request_for_comments, receiver)