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) request = AccessRequest.create(user: current_user, map: @map)
# what about push notification to map owner? # what about push notification to map owner?
mail = MapMailer.access_request_email(request, @map) 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| respond_to do |format|
format.json do format.json do
@ -40,7 +40,7 @@ class AccessController < ApplicationController
# who we then send an email to # who we then send an email to
user = User.find(user_id) user = User.find(user_id)
mail = MapMailer.invite_to_edit_email(@map, current_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 end
@map.remove_old_collaborators(user_ids) @map.remove_old_collaborators(user_ids)

View file

@ -4,7 +4,6 @@
<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>
<% binding.pry %> <%= raw @notification.body %>
<%= raw @notification.body.parts[1].encoded %>
</body> </body>
</html> </html>

View file

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

View file

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

View file

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