From 6f64cffa91d57505da0b1ff49daa810b135584cf Mon Sep 17 00:00:00 2001 From: Vidit Date: Thu, 2 Aug 2018 16:37:01 +0530 Subject: [PATCH] improve UI of digest email (#3113) * improve UI of digest email * minor changes * added links to settings and subscriptions --- .../subscription_mailer/send_digest.html.erb | 55 ++++++++++++++----- .../previews/subscription_mailer_preview.rb | 5 ++ 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 test/mailers/previews/subscription_mailer_preview.rb diff --git a/app/views/subscription_mailer/send_digest.html.erb b/app/views/subscription_mailer/send_digest.html.erb index f89fdc70e26..8365496e243 100644 --- a/app/views/subscription_mailer/send_digest.html.erb +++ b/app/views/subscription_mailer/send_digest.html.erb @@ -1,19 +1,46 @@
-

<%= @user.username.capitalize %>'s Digest

+

[Public Lab] Your Weekly Digest

-
-

Top picks for you

-
- +
+

Top picks for you

+
+ + <% @top_picks.each do |n| %> + + + + + + + + + <% if n.main_image.present? %> + + <% end %> + + + + + <% end %> +
+

<%= n.title %>

+
+
+ +
+
+ <%= n.author.username.capitalize %> +

Published Feb 2

+
+
colspan="2" <% end %> style="padding-bottom: 30px;"> +

<%= n.body.truncate(175) %> Read more

+
+ +
+
+
+

Click here to choose your followed topics

+

Click here to change your subscription settings

\ No newline at end of file diff --git a/test/mailers/previews/subscription_mailer_preview.rb b/test/mailers/previews/subscription_mailer_preview.rb new file mode 100644 index 00000000000..68b2dad9c65 --- /dev/null +++ b/test/mailers/previews/subscription_mailer_preview.rb @@ -0,0 +1,5 @@ +class SubscriptionMailerPreview < ActionMailer::Preview + def send_digest + SubscriptionMailer.send_digest(User.first.id, Node.last(2)) + end +end \ No newline at end of file