sends budget investment created email
This commit is contained in:
@@ -46,6 +46,7 @@ module Budgets
|
||||
@investment.author = current_user
|
||||
|
||||
if @investment.save
|
||||
Mailer.budget_investment_created(@investment).deliver_later
|
||||
redirect_to budget_investment_path(@budget, @investment),
|
||||
notice: t('flash.actions.create.budget_investment')
|
||||
else
|
||||
|
||||
@@ -74,6 +74,14 @@ class Mailer < ApplicationMailer
|
||||
end
|
||||
end
|
||||
|
||||
def budget_investment_created(investment)
|
||||
@investment = investment
|
||||
|
||||
with_user(@investment.author) do
|
||||
mail(to: @investment.author.email, subject: t('mailers.budget_investment_created.subject'))
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def with_user(user, &block)
|
||||
|
||||
16
app/views/mailer/budget_investment_created.html.erb
Normal file
16
app/views/mailer/budget_investment_created.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
Hola <%= @investment.author.name %>
|
||||
|
||||
Muchas gracias por crear tu proyecto <%= @investment.title %> para los Presupuestos Participativos de <%= @investment.budget.name %> de Madrid.
|
||||
|
||||
Te informaremos de cómo avanza el proceso, que también puedes seguir en
|
||||
<%= link_to budgets_url, budgets_url %>
|
||||
|
||||
Atentamente,
|
||||
|
||||
Área de Participación Ciudadana, Transparencia
|
||||
y Gobierno Abierto del Ayuntamiento de Madrid
|
||||
|
||||
<div class="social-share-full">
|
||||
<%= social_share_button_tag("#{@investment.title} #{setting['twitter_hashtag']}",
|
||||
url: budget_investment_url(@investment.budget, @investment)) %>
|
||||
</div>
|
||||
@@ -52,4 +52,6 @@ en:
|
||||
thanks: "Thank you very much."
|
||||
title: "Welcome to %{org}"
|
||||
button: Complete registration
|
||||
subject: "Invitation to %{org_name}"
|
||||
subject: "Invitation to %{org_name}"
|
||||
budget_investment_created:
|
||||
subject: "Thank you for creating a proposal!"
|
||||
@@ -52,4 +52,6 @@ es:
|
||||
thanks: "Muchas gracias."
|
||||
title: "Bienvenido a %{org}"
|
||||
button: Completar registro
|
||||
subject: "Invitación a %{org_name}"
|
||||
subject: "Invitación a %{org_name}"
|
||||
budget_investment_created:
|
||||
subject: "¡Gracias por crear una propuesta!"
|
||||
Reference in New Issue
Block a user