Skip to content

Commit b46a062

Browse files
committed
Improved email design
1 parent c79857d commit b46a062

File tree

4 files changed

+50
-6
lines changed

4 files changed

+50
-6
lines changed

app/views/invitation_mailer/invite_email.html.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<p>
44
<%= t(".body",
55
inviter: @invitation.inviter.display_name,
6-
family: @invitation.family.name) %>
6+
family: @invitation.family.name).html_safe %>
77
</p>
88

99
<%= link_to t(".accept_button"), @accept_url, class: "button" %>
1010

11-
<p><%= t(".expiry_notice", days: 3) %></p>
11+
<p class="footer"><%= t(".expiry_notice", days: 3) %></p>

app/views/layouts/mailer.html.erb

+46-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,56 @@
22
<html>
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
56
<style>
6-
/* Email styles need to be inline */
7+
/* Email-safe styles that work across clients */
8+
body {
9+
background-color: #f8fafc;
10+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
11+
line-height: 1.5;
12+
margin: 0;
13+
padding: 0;
14+
}
15+
.container {
16+
background-color: #ffffff;
17+
border-radius: 8px;
18+
margin: 20px auto;
19+
max-width: 600px;
20+
padding: 32px;
21+
text-align: center;
22+
}
23+
h1 {
24+
color: #1e293b;
25+
font-size: 24px;
26+
margin-bottom: 24px;
27+
}
28+
p {
29+
color: #475569;
30+
font-size: 16px;
31+
margin-bottom: 16px;
32+
}
33+
.button {
34+
background-color: #3b82f6;
35+
border-radius: 6px;
36+
color: #ffffff;
37+
display: inline-block;
38+
font-weight: 600;
39+
margin: 16px 0;
40+
padding: 12px 24px;
41+
text-decoration: none;
42+
}
43+
.footer {
44+
color: #64748b;
45+
font-size: 14px;
46+
margin-top: 32px;
47+
text-align: center;
48+
}
749
</style>
850
</head>
951

1052
<body>
11-
<%= yield %>
53+
<div class="container">
54+
<%= yield %>
55+
</div>
1256
</body>
1357
</html>

config/locales/mailers/invitation_mailer/en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
en:
22
invitation_mailer:
33
invite_email:
4-
subject: "%{inviter} has invited you to join their household"
4+
subject: "%{inviter} has invited you to join their household on Maybe!"
55
greeting: "You've been invited!"
66
body: "%{inviter} has invited you to join their household '%{family}' as a %{role}."
77
accept_button: "Accept Invitation"
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
en:
22
invitation_mailer:
33
invite_email:
4-
greeting: "Welcome!"
4+
greeting: "Welcome to Maybe!"
55
body: "%{inviter} has invited you to join the %{family} family on Maybe!"
66
accept_button: "Accept Invitation"
77
expiry_notice: "This invitation will expire in %{days} days"

0 commit comments

Comments
 (0)