From 5f44bb200f09e2c73d72560c4c47dc365481013f Mon Sep 17 00:00:00 2001
From: Ben Halpern
Date: Wed, 28 Mar 2018 16:19:01 -0400
Subject: [PATCH] Modify dev digest email copy/style (#157)
---
app/mailers/digest_mailer.rb | 13 ++++++++++++-
app/views/layouts/_mailer_content.html.erb | 8 ++++----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/app/mailers/digest_mailer.rb b/app/mailers/digest_mailer.rb
index 625b48a29..8f8228be3 100644
--- a/app/mailers/digest_mailer.rb
+++ b/app/mailers/digest_mailer.rb
@@ -7,7 +7,7 @@ class DigestMailer < ApplicationMailer
end
@articles = articles.first(6)
@digest_email = true
- mail(from: "yo@dev.to", to: @user.email, subject: "#{@articles.first.title} #{random_emoji} and #{@articles.size - 1} other top posts from your network.") do |format|
+ mail(from: "yo@dev.to", to: @user.email, subject: "#{@articles.first.title} #{random_emoji} and #{@articles.size - 1} #{email_end_phrase}") do |format|
format.html { render "layouts/mailer" }
end
end
@@ -15,4 +15,15 @@ class DigestMailer < ApplicationMailer
def random_emoji
["📖","🎉","🙈","🔥","💬","👋","👏","🐶","🦁","🦊","🐙","🦄","❤️"].shuffle.take(3).join
end
+
+ def email_end_phrase
+ [
+ "more posts picked just for you",
+ "more trending DEV posts",
+ "other posts you might like",
+ "other posts you should read",
+ "other articles picked for you",
+ "more wonderful posts"
+ ].sample
+ end
end
diff --git a/app/views/layouts/_mailer_content.html.erb b/app/views/layouts/_mailer_content.html.erb
index 0565e3bbe..1b1e4d101 100644
--- a/app/views/layouts/_mailer_content.html.erb
+++ b/app/views/layouts/_mailer_content.html.erb
@@ -179,10 +179,10 @@
PBJ
<% elsif @digest_email %>
-
- Your Personal DEV Digest
-
- Recent posts you might find valuable based on who you follow ❤️
+
+ DEV Digest
+
+ Recent posts you might find valuable based on who you follow ❤️
<% @articles.each do |article| %>