From 53d3282d8b11f1e772b7152dd6b88948be4156c1 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 12 May 2017 12:43:30 +0200 Subject: [PATCH 1/6] adds budget mailer for selected and unselected --- .../budget_investment_selected.html.erb | 40 +++++++++++++++++++ .../budget_investment_unselected.html.erb | 35 ++++++++++++++++ config/locales/mailers.en.yml | 21 +++++++++- config/locales/mailers.es.yml | 21 +++++++++- 4 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 app/views/mailer/budget_investment_selected.html.erb create mode 100644 app/views/mailer/budget_investment_unselected.html.erb diff --git a/app/views/mailer/budget_investment_selected.html.erb b/app/views/mailer/budget_investment_selected.html.erb new file mode 100644 index 000000000..76d49acba --- /dev/null +++ b/app/views/mailer/budget_investment_selected.html.erb @@ -0,0 +1,40 @@ + + +

+ <%= t("mailers.budget_investment_selected.hi") %> +

+ +

+ <%= t("mailers.budget_investment_selected.selected_html", + title: @investment.title) %> +

+ +

+ <%= t("mailers.budget_investment_selected.share", + url: link_to(t("mailers.budget_investment_selected.share_url"), + namespaced_budget_investment_path(@investment), style: "color: #2895F1; text-decoration: underline;")) %> +

+ + + + + + + +
+ <%= link_to budget_investment_url(@investment.budget, @investment, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66 !important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %> + <%= image_tag('icon_mailer_share.png', style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> + <%= t('mailers.budget_investment_selected.share_button') %> + <% end %> +
+ +

+ <%= t("mailers.budget_investment_selected.thanks") %> +

+ +

+ <%= t("mailers.budget_investment_selected.sincerely") %>
+ + <%= t("mailers.budget_investment_unfeasible.signatory") %> +

+ \ No newline at end of file diff --git a/app/views/mailer/budget_investment_unselected.html.erb b/app/views/mailer/budget_investment_unselected.html.erb new file mode 100644 index 000000000..7ffb25ef9 --- /dev/null +++ b/app/views/mailer/budget_investment_unselected.html.erb @@ -0,0 +1,35 @@ + + +

+ <%= t("mailers.budget_investment_unselected.hi") %> +

+ +

+ <%= t("mailers.budget_investment_unselected.unselected_html", + title: @investment.title) %> +

+ +

+ <%= @investment.unfeasibility_explanation %> +

+ +

+ <%= t("mailers.budget_investment_unselected.new_html", + url: link_to(t("mailers.budget_investment_unselected.new_href"), + new_budget_investment_url(@investment.budget), style: "color: #2895F1; text-decoration: underline;")) %> +

+ +

+ <%= t("mailers.budget_investment_unselected.reconsider_html", code: @investment.code) %> +

+ +

+ <%= t("mailers.budget_investment_unselected.sorry") %> +

+ +

+ <%= t("mailers.budget_investment_unselected.sincerely") %>
+ + <%= t("mailers.budget_investment_unselected.signatory") %> +

+ \ No newline at end of file diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 49143f354..9d5c74c8e 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -82,4 +82,23 @@ en: signatory: "DEPARTMENT OF PUBLIC PARTICIPATION" sorry: "Sorry for the inconvenience and we again thank you for your invaluable participation." subject: "Your investment project '%{code}' has been marked as unfeasible" - unfeasible_html: "From the City Council we want to thank you for your participation in the participatory budgets. We regret to inform you that your investment '%{title}' will be excluded from this participatory process for the following reason:" \ No newline at end of file + unfeasible_html: "From the City Council we want to thank you for your participation in the participatory budgets. We regret to inform you that your investment '%{title}' will be excluded from this participatory process for the following reason:" + budget_investment_selected: + subject: "Tu propuesta de inversión '%{code}' ha sido seleccionada" + hi: "Estimado usuario," + selected_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Queremos informarte de que tu proyecto '%{title}' ha sido seleccionado y pasa a la fase de votación final que tiene lugar desde el 15 de mayo hasta el 30 de junio." + share: "Te invitamos a que %{url} en redes sociales para promocionarlo y conseguir más votos." + share_url: "compartas tu proyecto de gasto" + share_button: "Comparte tu proyecto" + thanks: "Gracias de nuevo por tu participación." + sincerely: "Atentamente" + signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" + budget_investment_unselected: + subject: "Tu propuesta de inversión '%{code}' no ha sido seleccionada" + hi: "Estimado usuario," + unselected_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' no ha sido seleccionado para la fase de votación final." + participate: "De todas formas te invitamos a que %{url} votando otros proyectos desde el 15 de mayo hasta el 30 de junio." + participate_url: "participes en la votación final" + thanks: "Gracias de nuevo por tu participación." + sincerely: "Atentamente" + signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" \ No newline at end of file diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 82a03d8de..0e1bbd992 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -72,4 +72,23 @@ es: signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" sorry: "Sentimos las molestias ocasionadas y volvemos a darte las gracias por tu inestimable participación." subject: "Tu propuesta de inversión '%{code}' ha sido marcada como inviable" - unfeasible_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' quedará excluido de este proceso participativo por el siguiente motivo:" \ No newline at end of file + unfeasible_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' quedará excluido de este proceso participativo por el siguiente motivo:" + budget_investment_selected: + subject: "Tu propuesta de inversión '%{code}' ha sido seleccionada" + hi: "Estimado usuario," + selected_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Queremos informarte de que tu proyecto '%{title}' ha sido seleccionado y pasa a la fase de votación final que tiene lugar desde el 15 de mayo hasta el 30 de junio." + share: "Te invitamos a que %{url} en redes sociales para promocionarlo y conseguir más votos." + share_url: "compartas tu proyecto de gasto" + share_button: "Comparte tu proyecto" + thanks: "Gracias de nuevo por tu participación." + sincerely: "Atentamente" + signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" + budget_investment_unselected: + subject: "Tu propuesta de inversión '%{code}' no ha sido seleccionada" + hi: "Estimado usuario," + unselected_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' no ha sido seleccionado para la fase de votación final." + participate: "De todas formas te invitamos a que %{url} votando otros proyectos desde el 15 de mayo hasta el 30 de junio." + participate_url: "participes en la votación final" + thanks: "Gracias de nuevo por tu participación." + sincerely: "Atentamente" + signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" From 7a803999bdab9545ef2f60e23943534b2ced3524 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 12 May 2017 12:43:52 +0200 Subject: [PATCH 2/6] adds missing td tag on budget investment created mailer --- .../mailer/budget_investment_created.html.erb | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/app/views/mailer/budget_investment_created.html.erb b/app/views/mailer/budget_investment_created.html.erb index 59af63dd1..85052bedd 100644 --- a/app/views/mailer/budget_investment_created.html.erb +++ b/app/views/mailer/budget_investment_created.html.erb @@ -1,42 +1,43 @@ -

- <%= t("mailers.budget_investment_created.title") %> -

+

+ <%= t("mailers.budget_investment_created.title") %> +

-

- <%= t("mailers.budget_investment_created.intro_html", - author: @investment.author.name).html_safe %> -

+

+ <%= t("mailers.budget_investment_created.intro_html", + author: @investment.author.name).html_safe %> +

-

- <%= t("mailers.budget_investment_created.text_html", - investment: @investment.title, - budget: @investment.budget.name).html_safe %> -

+

+ <%= t("mailers.budget_investment_created.text_html", + investment: @investment.title, + budget: @investment.budget.name).html_safe %> +

-

- <%= t("mailers.budget_investment_created.follow_html", - link: link_to(t("mailers.budget_investment_created.follow_link"), budgets_url)).html_safe %> -

+

+ <%= t("mailers.budget_investment_created.follow_html", + link: link_to(t("mailers.budget_investment_created.follow_link"), budgets_url)).html_safe %> +

- - - - - - -
- <%= link_to budget_investment_url(@investment.budget, @investment, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %> - <%= image_tag('icon_mailer_share.png', style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> - <%= t('mailers.budget_investment_created.share') %> - <% end %> -
+ + + + + + +
+ <%= link_to budget_investment_url(@investment.budget, @investment, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %> + <%= image_tag('icon_mailer_share.png', style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> + <%= t('mailers.budget_investment_created.share') %> + <% end %> +
-

- <%= t("mailers.budget_investment_created.sincerely") %> -
- - <%= t("mailers.budget_investment_created.signatory") %> - -

+

+ <%= t("mailers.budget_investment_created.sincerely") %> +
+ + <%= t("mailers.budget_investment_created.signatory") %> + +

+ From 6217dbae633132fc340faf9013e61290923e1bdc Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 12 May 2017 12:47:57 +0200 Subject: [PATCH 3/6] adds new i18n on budget investment unselected mailer --- .../mailer/budget_investment_unselected.html.erb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/views/mailer/budget_investment_unselected.html.erb b/app/views/mailer/budget_investment_unselected.html.erb index 7ffb25ef9..8d796381a 100644 --- a/app/views/mailer/budget_investment_unselected.html.erb +++ b/app/views/mailer/budget_investment_unselected.html.erb @@ -9,22 +9,14 @@ title: @investment.title) %>

-

- <%= @investment.unfeasibility_explanation %> -

-

- <%= t("mailers.budget_investment_unselected.new_html", - url: link_to(t("mailers.budget_investment_unselected.new_href"), + <%= t("mailers.budget_investment_unselected.participate", + url: link_to(t("mailers.budget_investment_unselected.participate_url"), new_budget_investment_url(@investment.budget), style: "color: #2895F1; text-decoration: underline;")) %>

- <%= t("mailers.budget_investment_unselected.reconsider_html", code: @investment.code) %> -

- -

- <%= t("mailers.budget_investment_unselected.sorry") %> + <%= t("mailers.budget_investment_unselected.thanks") %>

From 712e576e75209159eff3379f6e97e6a2ffc13db4 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 12 May 2017 13:57:31 +0200 Subject: [PATCH 4/6] adds email delivery of selected and unselected investments --- app/mailers/mailer.rb | 18 ++++++++ app/models/budget.rb | 12 +++++ .../budget_investment_selected.html.erb | 2 +- .../budget_investment_unselected.html.erb | 2 +- config/locales/mailers.en.yml | 34 +++++++------- config/locales/mailers.es.yml | 10 ++-- lib/tasks/budgets.rake | 16 +++++++ spec/features/emails_spec.rb | 46 +++++++++++++++++++ 8 files changed, 116 insertions(+), 24 deletions(-) create mode 100644 lib/tasks/budgets.rake diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 188de029b..7e8970c61 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -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) diff --git a/app/models/budget.rb b/app/models/budget.rb index 5b2cdc558..a5932921c 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -113,6 +113,18 @@ class Budget < ActiveRecord::Base end end + def email_selected + investments.selected.each do |investment| + Mailer.budget_investment_selected(investment).deliver_later + end + end + + def email_unselected + investments.unselected.each do |investment| + Mailer.budget_investment_unselected(investment).deliver_later + end + end + private def sanitize_descriptions diff --git a/app/views/mailer/budget_investment_selected.html.erb b/app/views/mailer/budget_investment_selected.html.erb index 76d49acba..dce8fcc0d 100644 --- a/app/views/mailer/budget_investment_selected.html.erb +++ b/app/views/mailer/budget_investment_selected.html.erb @@ -12,7 +12,7 @@

<%= t("mailers.budget_investment_selected.share", url: link_to(t("mailers.budget_investment_selected.share_url"), - namespaced_budget_investment_path(@investment), style: "color: #2895F1; text-decoration: underline;")) %> + budget_url(@investment.budget), style: "color: #2895F1; text-decoration: underline;")) %>

diff --git a/app/views/mailer/budget_investment_unselected.html.erb b/app/views/mailer/budget_investment_unselected.html.erb index 8d796381a..12762effc 100644 --- a/app/views/mailer/budget_investment_unselected.html.erb +++ b/app/views/mailer/budget_investment_unselected.html.erb @@ -12,7 +12,7 @@

<%= t("mailers.budget_investment_unselected.participate", url: link_to(t("mailers.budget_investment_unselected.participate_url"), - new_budget_investment_url(@investment.budget), style: "color: #2895F1; text-decoration: underline;")) %> + budget_url(@investment.budget), style: "color: #2895F1; text-decoration: underline;")) %>

diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 9d5c74c8e..fa752c42c 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -84,21 +84,21 @@ en: subject: "Your investment project '%{code}' has been marked as unfeasible" unfeasible_html: "From the City Council we want to thank you for your participation in the participatory budgets. We regret to inform you that your investment '%{title}' will be excluded from this participatory process for the following reason:" budget_investment_selected: - subject: "Tu propuesta de inversión '%{code}' ha sido seleccionada" - hi: "Estimado usuario," - selected_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Queremos informarte de que tu proyecto '%{title}' ha sido seleccionado y pasa a la fase de votación final que tiene lugar desde el 15 de mayo hasta el 30 de junio." - share: "Te invitamos a que %{url} en redes sociales para promocionarlo y conseguir más votos." - share_url: "compartas tu proyecto de gasto" - share_button: "Comparte tu proyecto" - thanks: "Gracias de nuevo por tu participación." - sincerely: "Atentamente" - signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" + subject: "Your investment project '%{code}' has been selected" + hi: "Dear user," + selected_html: "From the City Council we want to thank you for your participation in the participatory budgets. We would like to inform you that your investment project '%{title}' has been selected for the final voting phase that will happen from May 15th to June 30th." + share: "We invite you to %{url} in social networks to promote it and achieve more votes." + share_url: "share your investment project" + share_button: "Share your investment project" + thanks: "Thank you again for participating." + sincerely: "Sincererly" + signatory: "DEPARTMENT OF PUBLIC PARTICIPATION" budget_investment_unselected: - subject: "Tu propuesta de inversión '%{code}' no ha sido seleccionada" - hi: "Estimado usuario," - unselected_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' no ha sido seleccionado para la fase de votación final." - participate: "De todas formas te invitamos a que %{url} votando otros proyectos desde el 15 de mayo hasta el 30 de junio." - participate_url: "participes en la votación final" - thanks: "Gracias de nuevo por tu participación." - sincerely: "Atentamente" - signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" \ No newline at end of file + subject: "Your investment project '%{code}' has not been selected" + hi: "Dear user," + unselected_html: "From the City Council we want to thank you for your participation in the participatory budgets. We regret to inform you that your investment project '%{title}' has not been selected for the final voting phase." + participate: "You can continue participating in the final voting phase voting for investments projects from May 15th to June 30th." + participate_url: "participate in the final voting" + thanks: "Thank you again for participating." + sincerely: "Sincererly" + signatory: "DEPARTMENT OF PUBLIC PARTICIPATION" \ No newline at end of file diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 0e1bbd992..84ec31796 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -75,8 +75,8 @@ es: unfeasible_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' quedará excluido de este proceso participativo por el siguiente motivo:" budget_investment_selected: subject: "Tu propuesta de inversión '%{code}' ha sido seleccionada" - hi: "Estimado usuario," - selected_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Queremos informarte de que tu proyecto '%{title}' ha sido seleccionado y pasa a la fase de votación final que tiene lugar desde el 15 de mayo hasta el 30 de junio." + hi: "Estimado/a usuario/a" + selected_html: "Desde el Ayuntamiento de Madrid agradecemos que hayas participado con tu idea en los Presupuestos Participativos. Te invitamos de que tu proyecto '%{title}' ha sido seleccionado y pasa a la fase de votación final que tiene lugar desde el 15 de mayo hasta el 30 de junio de 2017. Empieza ya a conseguir votos, comparte tu proyecto de gasto en redes sociales. La difusión es fundamental para conseguir que se haga realidad." share: "Te invitamos a que %{url} en redes sociales para promocionarlo y conseguir más votos." share_url: "compartas tu proyecto de gasto" share_button: "Comparte tu proyecto" @@ -85,9 +85,9 @@ es: signatory: "DIRECCIÓN GENERAL DE PARTICIPACIÓN CIUDADANA" budget_investment_unselected: subject: "Tu propuesta de inversión '%{code}' no ha sido seleccionada" - hi: "Estimado usuario," - unselected_html: "Desde el Ayuntamiento queremos agradecer tu participación en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' no ha sido seleccionado para la fase de votación final." - participate: "De todas formas te invitamos a que %{url} votando otros proyectos desde el 15 de mayo hasta el 30 de junio." + hi: "Estimado/a usuario/a" + unselected_html: "Desde el Ayuntamiento de Madrid agradecemos que hayas participado con tu idea en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' no ha sido seleccionado para la fase de votación final." + participate: "Puedes continuar participando en la votación final votando proyectos para toda la ciudad y el distrito que elijas desde el 15 de mayo hasta el 30 de junio de 2017." participate_url: "participes en la votación final" thanks: "Gracias de nuevo por tu participación." sincerely: "Atentamente" diff --git a/lib/tasks/budgets.rake b/lib/tasks/budgets.rake new file mode 100644 index 000000000..f9810ac1c --- /dev/null +++ b/lib/tasks/budgets.rake @@ -0,0 +1,16 @@ +namespace :budgets do + namespace :email do + + desc "Sends emails to authors of selected investments" + task selected: :environment do + Budget.last.email_selected + end + + desc "Sends emails to authors of unselected investments" + task unselected: :environment do + Budget.last.email_unselected + end + + end + +end \ No newline at end of file diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index b3e52370d..a42715734 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -321,5 +321,51 @@ feature 'Emails' do expect(email).to have_body_text(investment.unfeasibility_explanation) end + scenario "Selected investment" do + author1 = create(:user) + author2 = create(:user) + author3 = create(:user) + + investment1 = create(:budget_investment, :selected, author: author1, budget: budget) + investment2 = create(:budget_investment, :selected, author: author2, budget: budget) + investment3 = create(:budget_investment, :unselected, author: author3, budget: budget) + + reset_mailer + budget.email_selected + + expect(find_email investment1.author.email).to be + expect(find_email investment2.author.email).to be + expect(find_email investment3.author.email).to_not be + + email = open_last_email + investment = investment2 + expect(email).to have_subject("Your investment project '#{investment.code}' has been selected") + expect(email).to deliver_to(investment.author.email) + expect(email).to have_body_text(investment.title) + end + + scenario "Unselected investment" do + author1 = create(:user) + author2 = create(:user) + author3 = create(:user) + + investment1 = create(:budget_investment, :unselected, author: author1, budget: budget) + investment2 = create(:budget_investment, :unselected, author: author2, budget: budget) + investment3 = create(:budget_investment, :selected, author: author3, budget: budget) + + reset_mailer + budget.email_unselected + + expect(find_email investment1.author.email).to be + expect(find_email investment2.author.email).to be + expect(find_email investment3.author.email).to_not be + + email = open_last_email + investment = investment2 + expect(email).to have_subject("Your investment project '#{investment.code}' has not been selected") + expect(email).to deliver_to(investment.author.email) + expect(email).to have_body_text(investment.title) + end + end end From e8be4508fd14c19306dd4c77c309f935693dbeb0 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 12 May 2017 18:50:03 +0200 Subject: [PATCH 5/6] improves i18n of budgets mailers --- app/views/mailer/budget_investment_selected.html.erb | 6 ++---- config/locales/mailers.en.yml | 3 +-- config/locales/mailers.es.yml | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/views/mailer/budget_investment_selected.html.erb b/app/views/mailer/budget_investment_selected.html.erb index dce8fcc0d..6898f54a7 100644 --- a/app/views/mailer/budget_investment_selected.html.erb +++ b/app/views/mailer/budget_investment_selected.html.erb @@ -10,9 +10,7 @@

- <%= t("mailers.budget_investment_selected.share", - url: link_to(t("mailers.budget_investment_selected.share_url"), - budget_url(@investment.budget), style: "color: #2895F1; text-decoration: underline;")) %> + <%= t("mailers.budget_investment_selected.share" %>

@@ -35,6 +33,6 @@

<%= t("mailers.budget_investment_selected.sincerely") %>
- <%= t("mailers.budget_investment_unfeasible.signatory") %> + <%= t("mailers.budget_investment_selected.signatory") %>

\ No newline at end of file diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index fa752c42c..65ccb7467 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -87,8 +87,7 @@ en: subject: "Your investment project '%{code}' has been selected" hi: "Dear user," selected_html: "From the City Council we want to thank you for your participation in the participatory budgets. We would like to inform you that your investment project '%{title}' has been selected for the final voting phase that will happen from May 15th to June 30th." - share: "We invite you to %{url} in social networks to promote it and achieve more votes." - share_url: "share your investment project" + share: "Start to get votes, share your investment project on social networks. Share is essential to make it a reality." share_button: "Share your investment project" thanks: "Thank you again for participating." sincerely: "Sincererly" diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 84ec31796..42f0fc75b 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -76,9 +76,8 @@ es: budget_investment_selected: subject: "Tu propuesta de inversión '%{code}' ha sido seleccionada" hi: "Estimado/a usuario/a" - selected_html: "Desde el Ayuntamiento de Madrid agradecemos que hayas participado con tu idea en los Presupuestos Participativos. Te invitamos de que tu proyecto '%{title}' ha sido seleccionado y pasa a la fase de votación final que tiene lugar desde el 15 de mayo hasta el 30 de junio de 2017. Empieza ya a conseguir votos, comparte tu proyecto de gasto en redes sociales. La difusión es fundamental para conseguir que se haga realidad." - share: "Te invitamos a que %{url} en redes sociales para promocionarlo y conseguir más votos." - share_url: "compartas tu proyecto de gasto" + selected_html: "Desde el Ayuntamiento de Madrid agradecemos que hayas participado con tu idea en los Presupuestos Participativos. Te informamos de que tu proyecto '%{title}' ha sido seleccionado y pasa a la fase de votación final que tiene lugar desde el 15 de mayo hasta el 30 de junio de 2017." + share: "Empieza ya a conseguir votos, comparte tu proyecto de gasto en redes sociales. La difusión es fundamental para conseguir que se haga realidad." share_button: "Comparte tu proyecto" thanks: "Gracias de nuevo por tu participación." sincerely: "Atentamente" From 962dd097b790860b95adef396effebeac02e56a7 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 12 May 2017 19:12:19 +0200 Subject: [PATCH 6/6] fixes i18n --- app/views/mailer/budget_investment_selected.html.erb | 2 +- app/views/mailer/budget_investment_unselected.html.erb | 2 +- config/locales/mailers.en.yml | 2 +- config/locales/mailers.es.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/mailer/budget_investment_selected.html.erb b/app/views/mailer/budget_investment_selected.html.erb index 6898f54a7..71d0a475c 100644 --- a/app/views/mailer/budget_investment_selected.html.erb +++ b/app/views/mailer/budget_investment_selected.html.erb @@ -10,7 +10,7 @@

- <%= t("mailers.budget_investment_selected.share" %> + <%= t("mailers.budget_investment_selected.share") %>

diff --git a/app/views/mailer/budget_investment_unselected.html.erb b/app/views/mailer/budget_investment_unselected.html.erb index 12762effc..ec0224d77 100644 --- a/app/views/mailer/budget_investment_unselected.html.erb +++ b/app/views/mailer/budget_investment_unselected.html.erb @@ -10,7 +10,7 @@

- <%= t("mailers.budget_investment_unselected.participate", + <%= t("mailers.budget_investment_unselected.participate_html", url: link_to(t("mailers.budget_investment_unselected.participate_url"), budget_url(@investment.budget), style: "color: #2895F1; text-decoration: underline;")) %>

diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 65ccb7467..65da97b55 100755 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -96,7 +96,7 @@ en: subject: "Your investment project '%{code}' has not been selected" hi: "Dear user," unselected_html: "From the City Council we want to thank you for your participation in the participatory budgets. We regret to inform you that your investment project '%{title}' has not been selected for the final voting phase." - participate: "You can continue participating in the final voting phase voting for investments projects from May 15th to June 30th." + participate_html: "You can continue participating in the final voting phase voting for investments projects from May 15th to June 30th." participate_url: "participate in the final voting" thanks: "Thank you again for participating." sincerely: "Sincererly" diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index 42f0fc75b..dc51148f8 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -86,7 +86,7 @@ es: subject: "Tu propuesta de inversión '%{code}' no ha sido seleccionada" hi: "Estimado/a usuario/a" unselected_html: "Desde el Ayuntamiento de Madrid agradecemos que hayas participado con tu idea en los Presupuestos Participativos. Lamentamos informarte de que tu proyecto '%{title}' no ha sido seleccionado para la fase de votación final." - participate: "Puedes continuar participando en la votación final votando proyectos para toda la ciudad y el distrito que elijas desde el 15 de mayo hasta el 30 de junio de 2017." + participate_html: "Puedes continuar participando en la votación final votando proyectos para toda la ciudad y el distrito que elijas desde el 15 de mayo hasta el 30 de junio de 2017." participate_url: "participes en la votación final" thanks: "Gracias de nuevo por tu participación." sincerely: "Atentamente"