mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Improve emails (#305)
This commit is contained in:
committed by
GitHub
parent
5ad01b0138
commit
98daafc244
@@ -4,6 +4,13 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div><%= yield %></div>
|
||||
<div style="margin: 16px auto; text-align: center;">
|
||||
<a href="<%= add_subdomain_to(method(:root_url)) %>">
|
||||
<%= image_tag('logo.png', alt: 'Astuto Logo', size: 64) %>
|
||||
</a>
|
||||
</div>
|
||||
<div style="max-width: 580px; margin: 0 auto; border: 1px solid rgba(0, 0, 0, 0.125); border-radius: 0.25rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04),0 2px 4px -1px rgba(0, 0, 0, 0.03); padding: 24px; font-family: system-ui, sans-serif; font-size: 18px;">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<p><%= t('mailers.user.opening_greeting') %></p>
|
||||
|
||||
<div><%= yield %></div>
|
||||
|
||||
<p><%= t('mailers.user.closing_greeting') %></p>
|
||||
|
||||
<footer>
|
||||
<%=
|
||||
link_to(
|
||||
t('mailers.user.unsubscribe'),
|
||||
add_subdomain_to(method(:edit_user_registration_url))
|
||||
)
|
||||
%>.
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
<%= yield %>
|
||||
1
app/views/user_mailer/_closing.html.erb
Normal file
1
app/views/user_mailer/_closing.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<p><%= t('mailers.user.closing_greeting') %></p>
|
||||
1
app/views/user_mailer/_opening.html.erb
Normal file
1
app/views/user_mailer/_opening.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<p><%= t('mailers.user.opening_greeting', name: user_name) %></p>
|
||||
3
app/views/user_mailer/_quoted_text.html.erb
Normal file
3
app/views/user_mailer/_quoted_text.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<p style="width: 80%; margin: 32px auto; font-size: 16px; border: 1px solid rgba(0, 0, 0, 0.125); border-radius: 0.25rem; padding: 16px;">
|
||||
<%= text %>
|
||||
</p>
|
||||
11
app/views/user_mailer/_unsubscribe_from_post.html.erb
Normal file
11
app/views/user_mailer/_unsubscribe_from_post.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<footer>
|
||||
<hr style="border-top: 1px;">
|
||||
<p style="margin-bottom: 0; font-size: 14px; color: grey;">
|
||||
<%=
|
||||
t(
|
||||
'mailers.user.unsubscribe_from_post_html',
|
||||
href: link_to(t('mailers.user.unsubscribe_link'), add_subdomain_to(method(:post_url), post))
|
||||
)
|
||||
%>
|
||||
</p>
|
||||
</footer>
|
||||
11
app/views/user_mailer/_unsubscribe_from_site.html.erb
Normal file
11
app/views/user_mailer/_unsubscribe_from_site.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<footer>
|
||||
<hr style="border-top: 1px;">
|
||||
<p style="margin-bottom: 0; font-size: 14px; color: grey;">
|
||||
<%=
|
||||
t(
|
||||
'mailers.user.unsubscribe_from_site_html',
|
||||
href: link_to(t('mailers.user.unsubscribe_link'), add_subdomain_to(method(:edit_user_registration_url)))
|
||||
).html_safe
|
||||
%>
|
||||
</p>
|
||||
</footer>
|
||||
@@ -1,11 +1,15 @@
|
||||
<p>
|
||||
<%= t('mailers.user.notify_comment_owner.body', user: @comment.user.full_name, post: @comment.post.title) %>
|
||||
</p>
|
||||
<%= render 'user_mailer/opening', user_name: @user.full_name %>
|
||||
|
||||
<p>
|
||||
<i><%= @comment.body %></i>
|
||||
<%= t('mailers.user.notify_comment_owner.body_html', user: @comment.user.full_name, post: @comment.post.title) %>:
|
||||
</p>
|
||||
|
||||
<%= render 'user_mailer/quoted_text', text: @comment.body %>
|
||||
|
||||
<p>
|
||||
<%= link_to t('mailers.user.learn_more'), add_subdomain_to(method(:post_url), @comment.post) %>
|
||||
</p>
|
||||
|
||||
<%= render 'user_mailer/closing' %>
|
||||
|
||||
<%= render 'user_mailer/unsubscribe_from_site' %>
|
||||
@@ -0,0 +1,17 @@
|
||||
<%= render 'user_mailer/opening', user_name: @user.full_name %>
|
||||
|
||||
<p>
|
||||
<%= t('mailers.user.notify_follower_of_post_status_change.body_html', post: @post.title) %>:
|
||||
</p>
|
||||
|
||||
<p style="margin: 32px auto; text-align: center;">
|
||||
<span style='color: white; border-radius: 10rem; padding: 0.5rem; background-color: <%= @post.post_status.color %>;'><%= @post.post_status.name.upcase %></span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= link_to t('mailers.user.learn_more'), add_subdomain_to(method(:post_url), @post) %>
|
||||
</p>
|
||||
|
||||
<%= render 'user_mailer/closing' %>
|
||||
|
||||
<%= render 'user_mailer/unsubscribe_from_post', post: @post %>
|
||||
@@ -0,0 +1,15 @@
|
||||
<%= render 'user_mailer/opening', user_name: @user.full_name %>
|
||||
|
||||
<p>
|
||||
<%= t('mailers.user.notify_follower_of_post_update.body_html', user: @comment.user.full_name, post: @comment.post.title) %>:
|
||||
</p>
|
||||
|
||||
<%= render 'user_mailer/quoted_text', text: @comment.body %>
|
||||
|
||||
<p>
|
||||
<%= link_to t('mailers.user.learn_more'), add_subdomain_to(method(:post_url), @comment.post) %>
|
||||
</p>
|
||||
|
||||
<%= render 'user_mailer/closing' %>
|
||||
|
||||
<%= render 'user_mailer/unsubscribe_from_post', post: @comment.post %>
|
||||
@@ -1,10 +0,0 @@
|
||||
<p>
|
||||
<%= t('mailers.user.notify_followers_of_post_status_change.body', post: @post.title) %>
|
||||
<span style='color: white; border-radius: 10rem; padding: 0.5rem; background-color: <%= @post.post_status.color %>;'>
|
||||
<%= @post.post_status.name.upcase %>
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= link_to t('mailers.user.learn_more'), add_subdomain_to(method(:post_url), @post) %>
|
||||
</p>
|
||||
@@ -1,11 +0,0 @@
|
||||
<p>
|
||||
<%= t('mailers.user.notify_followers_of_post_update.body', user: @comment.user.full_name, post: @comment.post.title) %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i><%= @comment.body %></i>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= link_to t('mailers.user.learn_more'), add_subdomain_to(method(:post_url), @comment.post) %>
|
||||
</p>
|
||||
@@ -1,11 +1,15 @@
|
||||
<p>
|
||||
<%= t('mailers.user.notify_post_owner.body', user: @comment.user.full_name, post: @comment.post.title) %>
|
||||
</p>
|
||||
<%= render 'user_mailer/opening', user_name: @user.full_name %>
|
||||
|
||||
<p>
|
||||
<i><%= @comment.body %></i>
|
||||
<%= t('mailers.user.notify_post_owner.body_html', user: @comment.user.full_name, post: @comment.post.title) %>:
|
||||
</p>
|
||||
|
||||
<%= render 'user_mailer/quoted_text', text: @comment.body %>
|
||||
|
||||
<p>
|
||||
<%= link_to t('mailers.user.learn_more'), add_subdomain_to(method(:post_url), @comment.post) %>
|
||||
</p>
|
||||
|
||||
<%= render 'user_mailer/closing' %>
|
||||
|
||||
<%= render 'user_mailer/unsubscribe_from_post', post: @comment.post %>
|
||||
Reference in New Issue
Block a user