app/views/support_mailer/contact_message.html.erb
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html charset=UTF-8">
</head>
<body>
<%= comment_as_html(@contact_message.details) %>
<hr>
<footer>
<% if @contact_message.attachments.attached? %>
<p>Attachments</p>
<ul>
<% @contact_message.attachments.attachments.each do |attachment| %>
<li><%= link_to attachment.filename, rails_blob_url(attachment, disposition: "attachment") %></li>
<% end %>
</ul>
<% end %>
<p>
User was
<% if @contact_message.user.nil? %>
<strong>not</strong>
<% end %>
logged in when filling out the contact form.
</p>
<p>
<% if @contact_message.user %>
Sent by user <%= link_to @contact_message.user.name_with_fallback, admin_user_url(@contact_message.user) %>
<% elsif @possible_user %>
The following user matches the given email address:
<%= link_to @possible_user.name_with_fallback, admin_user_url(@possible_user) %>
<% else %>
Couldn't find a user with a matching email address
<% end %>
</p>
</footer>
</body>
</html>