sends notification email to each voter
This commit is contained in:
@@ -10,6 +10,9 @@ class ProposalNotificationsController < ApplicationController
|
||||
@notification = ProposalNotification.new(notification_params)
|
||||
@proposal = Proposal.find(notification_params[:proposal_id])
|
||||
if @notification.save
|
||||
@proposal.voters.each do |voter|
|
||||
Mailer.proposal_notification(@notification, voter).deliver_later
|
||||
end
|
||||
redirect_to @notification, notice: I18n.t("flash.actions.create.proposal_notification")
|
||||
else
|
||||
render :new
|
||||
|
||||
Reference in New Issue
Block a user