update style for new follower email (#20908)

This commit is contained in:
Philip How 2024-05-02 14:42:21 +01:00 committed by GitHub
parent 1cc59e08e0
commit 7c3e5b2b99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 109 additions and 73 deletions

View file

@ -0,0 +1,31 @@
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<table style="width:100%;" cellpadding="0" cellspacing="0">
<!-- Header -->
<tr>
<td align="left" bgcolor="#FFFFFF" style="padding: 25px 2px 35px; width: 50%">
<a href="<%= URL.url("/") %>">
<% if Settings::General.resized_logo.present? %>
<img width="50px" src="<%= optimized_image_url(URL.local_image(Settings::General.resized_logo), width: 50, fetch_format: "png")%>" alt="<%= community_name %>">
<% else %>
<span>
<%= community_name %>
</span>
<% end %>
</a>
</td>
<td align="right" bgcolor="#FFFFFF" style="padding: 25px 2px 35px; width:50%;">
<div width="50px" height="50px" style="width: 50px; height: 50px;">
<a href="<%= URL.user(@user) %>">
<img width="50px" height="50px" style="width: 50px; height: 50px; border-radius: 100%;" src="<%= URL.local_image(@user.profile_image_url_for(length: 50)) %>">
</a>
</div>
</td>
</tr>
</table>
<%= yield %>
</td>
</tr>
</table>

View file

@ -1,14 +1,47 @@
<% num_followers_past_days = Follow.followable_user(@user.id).where("created_at > ?", 24.hours.ago).size %>
<%= render 'mailers/notify_mailer/email_header' do %>
<table style="width:100%;" cellpadding="0" cellspacing="0">
<!-- Heading -->
<tr>
<td align="center" bgcolor="#FFFFFF" style="padding: 25px 2px 35px;">
<h1 style="margin: 0; font-size: 24px; color: #333;">
<%= @follower.name %></a> just followed you on <%= community_name %>
</h1>
</td>
</tr>
<tr>
<td align="center">
<img style="border-radius:100%;" width="150px"
src="<%= optimized_image_url(URL.local_image(@follower.profile_image), width: 150)%>"
alt="<%= @follower.name %> profile image">
</td>
</tr>
<tr>
<td style="padding: 24px 8px; text-align: center;">
<a style="background:<%= Settings::UserExperience.primary_brand_color_hex %>;color:white;padding:8px 30px;border-radius:6px;text-decoration:none;display:inline-block;margin-top:4px;font-size:20px"
href='<%= URL.user(@follower) %>'>
View their profile
</a>
</td>
</tr>
<tr>
<td style="padding: 24px 8px">
<table style="width:100%;" cellpadding="0" cellspacing="0">
<tr>
<td style="width: 30px"></td>
<td bgcolor="#F8F8F8"
style="padding: 8px; text-align: center; color: #3a3c3d; font-size: 16px; border-radius: 8px;">
<h3 style="font-weight:600">You now have <%= pluralize(@user.good_standing_followers_count, "total follower"
) %>.
<p>
When someone follows you on <%= community_name %>, your posts will be prioritized in their feed and
notifications. The perks of popularity I suppose.
</p>
<% if num_followers_past_days.positive? %>
<h3 style="font-weight:600;font-size:0.95em;color:#3ac1b4">You have <%= num_followers_past_days %> new <%= community_name %> followers in the past day!</h3>
</td>
<td style="width: 30px"></td>
</tr>
</table>
</td>
</tr>
</table>
<% end %>
<h2 style="font-size:32px;">
<a href="<%= user_url(@follower) %>"><%= @follower.name %></a> just followed you 🤗</h2>
<h3 style="font-weight:600">You now have <%= pluralize(@user.good_standing_followers_count, "total follower") %>. See all of your recent followers
<a href="<%= app_url("/dashboard/user_followers") %>">right here</a>.</h3>
<p>
When someone follows you on
<a href="<%= app_url %>"><%= community_name %></a>, your posts will be prioritized in their feed and notifications. The perks of popularity I suppose.
</p>

View file

@ -1,65 +1,37 @@
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<table style="width:100%;" cellpadding="0" cellspacing="0">
<!-- Header -->
<tr>
<td align="left" bgcolor="#FFFFFF" style="padding: 25px 2px 35px; width: 50%">
<a href="<%= URL.url("/") %>">
<% if Settings::General.resized_logo.present? %>
<img width="50px" src="<%= optimized_image_url(URL.local_image(Settings::General.resized_logo), width: 50, fetch_format: "png")%>" alt="<%= community_name %>">
<% else %>
<span>
<%= community_name %>
</span>
<% end %>
</a>
</td>
<td align="right" bgcolor="#FFFFFF" style="padding: 25px 2px 35px; width:50%;">
<div width="50px" height="50px" style="width: 50px; height: 50px;">
<a href="<%= URL.user(@user) %>">
<img width="50px" height="50px" style="width: 50px; height: 50px;" src="<%= URL.local_image(@user.profile_image_url_for(length: 50)) %>">
</a>
</div>
</td>
</tr>
</table>
<%= render 'mailers/notify_mailer/email_header' do %>
<table style="width:100%;" cellpadding="0" cellspacing="0">
<!-- Heading -->
<tr>
<td align="center" bgcolor="#FFFFFF" style="padding: 25px 2px 35px;">
<h1 style="margin: 0; font-size: 24px; color: #333;"> <%= @comment.user.name %> replied to you on <%= community_name %> </h1>
</td>
</tr>
<table style="width:100%;" cellpadding="0" cellspacing="0">
<!-- Heading -->
<tr>
<td align="center" bgcolor="#FFFFFF" style="padding: 25px 2px 35px;">
<h1 style="margin: 0; font-size: 24px; color: #333;"> <%= @comment.user.name %> replied to you on <%= community_name %> </h1>
</td>
</tr>
<!-- Content -->
<tr>
<td>
<table style="width:100%;" cellpadding="0" cellspacing="0">
<tr>
<td style="width: 30px"></td>
<td bgcolor="#F8F8F8" style="padding: 8px; text-align: left; color: #3a3c3d; font-size: 16px; border-radius: 8px;">
<h2 style="font-size:18px;color:rgb(107, 107, 107)">re: <em><%= @comment.commentable&.title || "Content No Longer Available" %></em></h2>
<!-- Content -->
<tr>
<td>
<table style="width:100%;" cellpadding="0" cellspacing="0">
<tr>
<td style="width: 30px"></td>
<td bgcolor="#F8F8F8" style="padding: 8px; text-align: left; color: #3a3c3d; font-size: 16px; border-radius: 8px;">
<h2 style="font-size:18px;color:rgb(107, 107, 107)">re: <em><%= @comment.commentable&.title || "Content No Longer Available" %></em></h2>
<%= @truncated_comment %>
<%= @truncated_comment %>
</td>
<td style="width: 30px"></td>
</tr>
</table>
</td>
</tr>
</td>
<td style="width: 30px"></td>
</tr>
</table>
</td>
</tr>
<!-- CTA -->
<tr>
<td style="padding: 16px 8px; text-align: center;">
<a style="background:<%= Settings::UserExperience.primary_brand_color_hex %>;color:white;padding:8px 30px;border-radius:6px;text-decoration:none;display:inline-block;margin-top:4px;font-size:20px" href='<%= comment_url(@comment) %>'>
View reply
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- CTA -->
<tr>
<td style="padding: 16px 8px; text-align: center;">
<a style="background:<%= Settings::UserExperience.primary_brand_color_hex %>;color:white;padding:8px 30px;border-radius:6px;text-decoration:none;display:inline-block;margin-top:4px;font-size:20px" href='<%= comment_url(@comment) %>'>
View reply
</a>
</td>
</tr>
</table>
<% end %>