From e550a40f90ad4a1d774a3d06e67ca5300f36e7d4 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 7 Jun 2016 16:12:16 +0200 Subject: [PATCH] Adds share and comment button on email --- app/assets/images/icon_mailer_comment.png | Bin 0 -> 251 bytes app/assets/images/icon_mailer_share.png | Bin 0 -> 379 bytes app/mailers/mailer.rb | 2 +- .../mailer/proposal_notification.html.erb | 22 +++++++++++++++++- app/views/proposals/show.html.erb | 2 +- config/locales/mailers.en.yml | 5 +++- config/locales/mailers.es.yml | 3 +++ 7 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 app/assets/images/icon_mailer_comment.png create mode 100644 app/assets/images/icon_mailer_share.png diff --git a/app/assets/images/icon_mailer_comment.png b/app/assets/images/icon_mailer_comment.png new file mode 100644 index 0000000000000000000000000000000000000000..d3c9bff738825499e7c06f8a2adce4b5d17b586c GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ za0`PlBg3pY5@fx({`eF=FuU@JE6u`H t^}0y%m%?NFP723uJSgy8?a}=M%yHKgpUwZrxEbhB22WQ%mvv4FO#oa~T$ca< literal 0 HcmV?d00001 diff --git a/app/assets/images/icon_mailer_share.png b/app/assets/images/icon_mailer_share.png new file mode 100644 index 0000000000000000000000000000000000000000..f95d44141b621be582501edd89e8cbdf98321ba1 GIT binary patch literal 379 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ za0`PlBg3pY5)2HCvYsxEAr`$yCv5a$P84WK|9|9!JjegHc^wIgON8HiRn572%&hl^ z%(f&|j%i9^N)gdrD^>Uv#FWhL9c6yVHF-@d%U7HJIlaN>jPAel;}um^ntrc(e(FtK zhAXR>q}E>RHMahCkAJg{bO=+4)m+vdx6^K4TwH#CKKm@Twk^ijW!u@Daud1ovpEcl zL>h|IUW=^!Cc9x4x2;Oy9ucP(lZw+>_6S{!o1_xX5VNGpt3mqMM=_VHUDu30dmZ^B zvGQHbSJx*UGxZtH)Jm{62rzZOvNg_smaepkZNbM(5eAnh6GHh8iTgg{%I_2h3;qYyYi)m*Ktk X)PU#K>!xG?Lyy7J)z4*}Q$iB}&@_=P literal 0 HcmV?d00001 diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index b8ca433ce..447daabc4 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -46,7 +46,7 @@ class Mailer < ApplicationMailer @notification = notification with_user(voter) do - mail(to: voter.email, subject: @notification.title) + mail(to: voter.email, subject: @notification.title + ": " + @notification.proposal.title) end end diff --git a/app/views/mailer/proposal_notification.html.erb b/app/views/mailer/proposal_notification.html.erb index 59489840c..3bcfccc1b 100644 --- a/app/views/mailer/proposal_notification.html.erb +++ b/app/views/mailer/proposal_notification.html.erb @@ -4,6 +4,26 @@

- <%= @notification.body %> + <%= @notification.body %>

+ + + + + + + + + +
+ <%= link_to "#comments", 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: 200px; display: inline-block;" do %> + <%= image_tag('icon_mailer_share.png', style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> + <%= t('mailers.proposal_notification.share') %> + <% end %> + + <%= link_to "#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: 200px; display: inline-block;" do %> + <%= image_tag('icon_mailer_comment.png', style: "border: 0; display: inline-block; width: 100%; max-width: 16px; vertical-align: middle;", alt: "") %> + <%= t('mailers.proposal_notification.comment') %> + <% end %> +
diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 8a391a031..2153b23e5 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -103,7 +103,7 @@ { proposal: @proposal, vote_url: vote_proposal_path(@proposal, value: 'yes') } %> - +

<%= t("proposals.show.share") %>