ok, the mailboxer emails mostly work

This commit is contained in:
Devin Howard 2016-11-29 12:52:25 -05:00
parent b0e723fe4b
commit 606bfedb91
5 changed files with 6 additions and 8 deletions

View file

@ -22,7 +22,7 @@ class AccessController < ApplicationController
request = AccessRequest.create(user: current_user, map: @map)
# what about push notification to map owner?
mail = MapMailer.access_request_email(request, @map)
@map.user.notify(mail.subject, mail.body)
@map.user.notify(mail.subject, mail.body.parts[1].body.to_s)
respond_to do |format|
format.json do
@ -40,7 +40,7 @@ class AccessController < ApplicationController
# who we then send an email to
user = User.find(user_id)
mail = MapMailer.invite_to_edit_email(@map, current_user, User.find(user_id))
user.notify(mail.subject, mail.body)
user.notify(mail.subject, mail.body.parts[1].body.to_s)
end
@map.remove_old_collaborators(user_ids)

View file

@ -4,7 +4,6 @@
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
<% binding.pry %>
<%= raw @notification.body.parts[1].encoded %>
<%= raw @notification.body %>
</body>
</html>

View file

@ -1,2 +1 @@
<% body = @notification.body.parts[0].encoded %>
<%= body.html_safe? ? body : strip_tags(body) %>
<%= @notification.body.html_safe? ? @notification.body : strip_tags(@notification.body) %>

View file

@ -13,7 +13,7 @@
<%= notification.subject %>
</div>
<div class="notification-body">
<%= notification.body.truncate(70) %>
<%= strip_tags(notification.body).truncate(70) %>
</div>
<% end %>
<div class="notification-read-unread">

View file

@ -4,7 +4,7 @@
<div id="yield">
<div class="centerContent notificationPage">
<h2 class="title"><%= @notification.subject %></h4>
<%= @notification.body %>
<%= raw @notification.body %>
<div class="back">
<%= link_to 'Back', notifications_path %>
</div>