feat: Add support for HTML emails in outgoing messages (#12662)
This PR adds sending custom HTML content in outgoing email messages
through Chatwoot's Email channels, while maintaining backward
compatibility with existing markdown rendering.
### API Usage
**Endpoint:** `POST
/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages`
```json
{
"content": "Fallback text content",
"email_html_content": "<div><h1>Welcome!</h1><p>This is <strong>custom HTML</strong></p></div>"
}
```
---------
Co-authored-by: Muhsin <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<% if @message.content %>
|
||||
<%= ChatwootMarkdownRenderer.new(@message.outgoing_content).render_message %>
|
||||
<% if @message.content_attributes.dig('email', 'html_content', 'reply').present? %>
|
||||
<%= @message.content_attributes.dig('email', 'html_content', 'reply').html_safe %>
|
||||
<% elsif @message.content %>
|
||||
<%= ChatwootMarkdownRenderer.new(@message.outgoing_content).render_message %>
|
||||
<% end %>
|
||||
<% if @large_attachments.present? %>
|
||||
<p>Attachments:</p>
|
||||
<% @large_attachments.each do |attachment| %>
|
||||
<p><a href="<%= attachment.file_url %>" target="_blank"><%= attachment.file.filename.to_s %></a></p>
|
||||
<% end %>
|
||||
<p>Attachments:</p>
|
||||
<% @large_attachments.each do |attachment| %>
|
||||
<p><a href="<%= attachment.file_url %>" target="_blank"><%= attachment.file.filename.to_s %></a></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user