Modify dev digest email copy/style (#157)

This commit is contained in:
Ben Halpern 2018-03-28 16:19:01 -04:00 committed by GitHub
parent 4f1c771b55
commit 5f44bb200f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View file

@ -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

View file

@ -179,10 +179,10 @@
PBJ
</p>
<% elsif @digest_email %>
<h2>
Your Personal DEV Digest
</h2>
<h4>Recent posts you might find valuable based on who you follow ❤️</h4>
<h1 style="text-align: center;">
DEV Digest
</h1>
<h4 style="text-align: center;">Recent posts you might find valuable based on who you follow ❤️</h4>
<% @articles.each do |article| %>
<ul>
<li>