Chatwoot/app/views/mailers/conversation_reply_mailer/conversation_transcript.html.erb
Sojan Jose 13073629bb
feat: Enable Markdown Parsing in emails (#1663)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2021-01-18 11:43:31 +05:30

21 lines
666 B
Text

<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) %>
<% @messages.each do |message| %>
<tr>
<td>
<b><%= message.sender&.try(:available_name) || message.sender&.name || '' %></b>
</td>
</tr>
<tr>
<td style="padding-bottom: 16px;">
<% if message.content %>
<%= markdown.render(message.content).html_safe %>
<% end %>
<% if message.attachments %>
<% message.attachments.each do |attachment| %>
Attachment [<a href="<%= attachment.file_url %>" _target="blank">Click here to view</a>]
<% end %>
<% end %>
<br />
</td>
</tr>
<% end %>