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>
12 lines
508 B
Plaintext
12 lines
508 B
Plaintext
<% 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 %>
|
|
<% end %>
|