Modify dev digest email copy/style (#157)
This commit is contained in:
parent
4f1c771b55
commit
5f44bb200f
2 changed files with 16 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue