adds email delivery of selected and unselected investments

This commit is contained in:
rgarcia
2017-05-12 13:57:31 +02:00
parent 6217dbae63
commit 712e576e75
8 changed files with 116 additions and 24 deletions

View File

@@ -91,6 +91,24 @@ class Mailer < ApplicationMailer
end
end
def budget_investment_selected(investment)
@investment = investment
@author = investment.author
with_user(@author) do
mail(to: @author.email, subject: t('mailers.budget_investment_selected.subject', code: @investment.code))
end
end
def budget_investment_unselected(investment)
@investment = investment
@author = investment.author
with_user(@author) do
mail(to: @author.email, subject: t('mailers.budget_investment_unselected.subject', code: @investment.code))
end
end
private
def with_user(user, &block)