feat: Enable Markdown Parsing in emails (#1663)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) %>
|
||||
<% @messages.each do |message| %>
|
||||
<tr>
|
||||
<td>
|
||||
@@ -7,7 +8,7 @@
|
||||
<tr>
|
||||
<td style="padding-bottom: 16px;">
|
||||
<% if message.content %>
|
||||
<%= message.content %>
|
||||
<%= markdown.render(message.content).html_safe %>
|
||||
<% end %>
|
||||
<% if message.attachments %>
|
||||
<% message.attachments.each do |attachment| %>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) %>
|
||||
<p>Hi <%= @contact.name %>,</p>
|
||||
|
||||
<p>You have new messages on your conversation.</p>
|
||||
@@ -11,7 +12,7 @@
|
||||
<tr>
|
||||
<td style="padding: 10px 20px; margin: 5px 0 20px 0; background: #F2F3F7; border-radius: 10px; display: inline-block; font-family: "Helvetica Neue",Tahoma,Arial,sans-serif; text-align: start; unicode-bidi: plaintext;">
|
||||
<% if message.content %>
|
||||
<%= message.content %>
|
||||
<%= markdown.render(message.content).html_safe %>
|
||||
<% end %>
|
||||
<% if message.attachments %>
|
||||
<% message.attachments.each do |attachment| %>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) %>
|
||||
|
||||
<% @messages.each do |message| %>
|
||||
<p style="font-family: Roboto,"Helvetica Neue",Tahoma,Arial,sans-serif; text-align: start; unicode-bidi: plaintext;">
|
||||
<% if message.content %>
|
||||
<%= message.content.gsub("\n", "<br/>").html_safe %>
|
||||
<%= markdown.render(message.content).html_safe %>
|
||||
<% end %>
|
||||
<% if message.attachments %>
|
||||
<% message.attachments.each do |attachment| %>
|
||||
|
||||
Reference in New Issue
Block a user