better email

This commit is contained in:
Connor Turland 2016-04-22 12:02:06 -04:00
parent 46540ff753
commit d90e51eb1e
5 changed files with 17 additions and 7 deletions

View file

@ -4,7 +4,6 @@ class MapMailer < ApplicationMailer
def invite_to_edit_email(map, inviter, invitee) def invite_to_edit_email(map, inviter, invitee)
@inviter = inviter @inviter = inviter
@map = map @map = map
@url = map_url(@map)
subject = @map.name + ' - Invitation to edit' subject = @map.name + ' - Invitation to edit'
mail(to: invitee.email, subject: subject) mail(to: invitee.email, subject: subject)
end end

View file

@ -3,11 +3,20 @@
<head> <head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' /> <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
</head> </head>
<body> <body style="font-family: sans-serif; width: 100%; padding: 24px 16px 16px 16px; background-color: #f5f5f5; text-align: center;">
<p><%= @inviter.name %> has invited you to <span style="font-weight: bold">collaboratively edit</span> the following map on Metamaps:</p> <div style="padding: 16px; background: white; text-align: left;">
<p style="font-weight: bold;"><%= link_to @map.name, @url %></p> <% button_style = "background-color:#a354cd;border:1px solid #673AB7;border-radius:2px;color:white;display:inline-block;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:12px;font-weight:bold;min-height:29px;line-height:29px;min-width:54px;outline:0px;padding:0 8px;text-align:center;text-decoration:none" %>
<p style="font-size: 11px;">Make sense with Metamaps</p> <p><span style="font-weight: bold;"><%= @inviter.name %></span> has invited you to <span style="font-weight: bold">collaboratively edit</span> the following map on Metamaps:</p>
<p><%= link_to @map.name, map_url(@map), target: "_blank", style: "font-size: 18px; text-decoration: none; color: #a354cd;" %></p>
<% if @map.desc %>
<p style="font-size: 12px;"><%= @map.desc %></p>
<% end %>
<%= link_to 'Open in Metamaps', map_url(@map), target: "_blank", style: button_style %>
<p style="font-size: 12px;">Make sense with Metamaps</p>
</div>
</body> </body>
</html> </html>

View file

@ -1,6 +1,6 @@
<%= @inviter.name %> has invited you to collaboratively edit the following map on Metamaps: <%= @inviter.name %> has invited you to collaboratively edit the following map on Metamaps:
<%= @map.name + ' [' + @url + ']' %> <%= @map.name %> [<%= map_url(@map) %>]
Make sense with Metamaps Make sense with Metamaps

Binary file not shown.

View file

@ -1,4 +1,6 @@
# Preview all emails at http://localhost:3000/rails/mailers/map_mailer # Preview all emails at http://localhost:3000/rails/mailers/map_mailer
class MapMailerPreview < ActionMailer::Preview class MapMailerPreview < ActionMailer::Preview
def invite_to_edit_email
MapMailer.invite_to_edit_email(Map.first, User.first, User.second)
end
end end