sends notification email to each voter

This commit is contained in:
rgarcia
2016-06-01 21:40:23 +02:00
parent 6e4ed0b895
commit ca26b3423b
6 changed files with 53 additions and 3 deletions

View File

@@ -42,6 +42,14 @@ class Mailer < ApplicationMailer
end
end
def proposal_notification(notification, voter)
@notification = notification
with_user(voter) do
mail(to: voter.email, subject: @notification.title)
end
end
private
def with_user(user, &block)