From 4b6f0590215198684076994f43381e547f56f790 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Mon, 12 Dec 2016 22:07:15 -0500 Subject: [PATCH] restructure email templates --- .../new_notification_email.html.erb | 12 ++++++---- .../new_notification_email.text.erb | 4 ++++ .../map_mailer/access_request_email.html.erb | 22 +++++-------------- .../map_mailer/access_request_email.text.erb | 2 -- .../map_mailer/invite_to_edit_email.html.erb | 22 ++++++------------- .../map_mailer/invite_to_edit_email.text.erb | 4 ---- 6 files changed, 25 insertions(+), 41 deletions(-) diff --git a/app/views/mailboxer/notification_mailer/new_notification_email.html.erb b/app/views/mailboxer/notification_mailer/new_notification_email.html.erb index 87d8da33..7f680869 100644 --- a/app/views/mailboxer/notification_mailer/new_notification_email.html.erb +++ b/app/views/mailboxer/notification_mailer/new_notification_email.html.erb @@ -1,6 +1,10 @@ <% mail = ApplicationMailer.mail_for_notification(@notification) %> -<% if mail %> - <% @notification.update(body: mail.html_part&.body&.decoded) %> - <%= raw mail.html_part&.body&.decoded %> -<% end %> +
+ <% if mail %> + <% @notification.update(body: mail.html_part&.body&.decoded) %> + <%= raw mail.html_part&.body&.decoded %> + <% end %> +

Make sense with Metamaps

+ <%= render partial: 'shared/mailer_unsubscribe_link' %> +
diff --git a/app/views/mailboxer/notification_mailer/new_notification_email.text.erb b/app/views/mailboxer/notification_mailer/new_notification_email.text.erb index 58623b16..a98af833 100644 --- a/app/views/mailboxer/notification_mailer/new_notification_email.text.erb +++ b/app/views/mailboxer/notification_mailer/new_notification_email.text.erb @@ -2,3 +2,7 @@ <% if mail %> <%= mail.text_part&.body&.decoded %> <% end %> + +Make sense with Metamaps + +<%= render partial: 'shared/mailer_unsubscribe_link' %> diff --git a/app/views/map_mailer/access_request_email.html.erb b/app/views/map_mailer/access_request_email.html.erb index f1569815..74d666bd 100644 --- a/app/views/map_mailer/access_request_email.html.erb +++ b/app/views/map_mailer/access_request_email.html.erb @@ -1,16 +1,6 @@ -
- <% button_style = "background-color:#4fc059;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" %> - -

<%= @request.user.name %> is requesting access to collaboratively edit the following map:

- -

<%= @map.name %>

- -

<%= link_to "Allow", approve_access_map_url(id: @map.id, request_id: @request.id), style: "font-size: 18px; text-decoration: none; color: #4fc059;" %> -

<%= link_to "Decline", deny_access_map_url(id: @map.id, request_id: @request.id), style: "font-size: 18px; text-decoration: none; color: #DB5D5D;" %>

- - <%= link_to 'Open in Metamaps', map_url(@map), style: button_style %> - -

Make sense with Metamaps

- - <%= render partial: 'shared/mailer_unsubscribe_link' %> -
+<% button_style = "background-color:#4fc059;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" %> +

<%= @request.user.name %> is requesting access to collaboratively edit the following map:

+

<%= @map.name %>

+

<%= link_to "Allow", approve_access_map_url(id: @map.id, request_id: @request.id), style: "font-size: 18px; text-decoration: none; color: #4fc059;" %> +

<%= link_to "Decline", deny_access_map_url(id: @map.id, request_id: @request.id), style: "font-size: 18px; text-decoration: none; color: #DB5D5D;" %>

+<%= link_to 'Go to Map', map_url(@map), style: button_style %> diff --git a/app/views/map_mailer/access_request_email.text.erb b/app/views/map_mailer/access_request_email.text.erb index 25ccb2bd..ef302a8b 100644 --- a/app/views/map_mailer/access_request_email.text.erb +++ b/app/views/map_mailer/access_request_email.text.erb @@ -5,6 +5,4 @@ Allow [<%= approve_access_map_url(id: @map.id, request_id: @request.id) %>] Decline [<%= deny_access_map_url(id: @map.id, request_id: @request.id) %>] -Make sense with Metamaps -<%= render partial: 'shared/mailer_unsubscribe_link' %> diff --git a/app/views/map_mailer/invite_to_edit_email.html.erb b/app/views/map_mailer/invite_to_edit_email.html.erb index c14ccd35..aba7cfd4 100644 --- a/app/views/map_mailer/invite_to_edit_email.html.erb +++ b/app/views/map_mailer/invite_to_edit_email.html.erb @@ -1,15 +1,7 @@ -
- <% button_style = "background-color:#4fc059;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" %> - -

<%= @inviter.name %> has invited you to collaboratively edit the following map:

-

<%= link_to @map.name, map_url(@map), style: "font-size: 18px; text-decoration: none; color: #4fc059;" %>

- <% if @map.desc %> -

<%= @map.desc %>

- <% end %> - - <%= link_to 'Open in Metamaps', map_url(@map), style: button_style %> - -

Make sense with Metamaps

- - <%= render partial: 'shared/mailer_unsubscribe_link' %> -
+<% button_style = "background-color:#4fc059;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" %> +

<%= @inviter.name %> has invited you to collaboratively edit the following map:

+

<%= link_to @map.name, map_url(@map), style: "font-size: 18px; text-decoration: none; color: #4fc059;" %>

+<% if @map.desc %> +

<%= @map.desc %>

+<% end %> +<%= link_to 'Go to Map', map_url(@map), style: button_style %> diff --git a/app/views/map_mailer/invite_to_edit_email.text.erb b/app/views/map_mailer/invite_to_edit_email.text.erb index 7d3bf397..4e822842 100644 --- a/app/views/map_mailer/invite_to_edit_email.text.erb +++ b/app/views/map_mailer/invite_to_edit_email.text.erb @@ -1,7 +1,3 @@ <%= @inviter.name %> has invited you to collaboratively edit the following map: <%= @map.name %> [<%= map_url(@map) %>] - -Make sense with Metamaps - -<%= render partial: 'shared/mailer_unsubscribe_link' %>