feat: Move email attachments from links to file attachments (#11304)
Add ability to send files as attachments instead of links Fixes: https://github.com/chatwoot/chatwoot/issues/1074 ## Changes - `emaily_reply` : We will attach the small attachments as attachments and large ones as links - `reply_with_summary`, `conversation_transcript`, `reply_with_out_summary` : We will change the attachment format to the following instead of the previous `View the attachment here` ``` Attachments: file_name file_name2 ``` --------- ref: https://github.com/chatwoot/chatwoot/pull/10318/files -> for fixing : https://github.com/chatwoot/chatwoot/pull/9655#issuecomment-2183962550 --------- Co-authored-by: Marco Marinho <marcomarinho12@gmail.com> Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
@@ -32,9 +32,10 @@
|
||||
<% if message.content %>
|
||||
<%= ChatwootMarkdownRenderer.new(message.content).render_message %>
|
||||
<% end %>
|
||||
<% if message.attachments %>
|
||||
<% if message.attachments.present? %>
|
||||
<p>Attachments:</p>
|
||||
<% message.attachments.each do |attachment| %>
|
||||
Attachment [<a href="<%= attachment.file_url %>" _target="blank">Click here to view</a>]
|
||||
<p><a href="<%= attachment.file_url %>" target="_blank"><%= attachment.file.filename.to_s %></a></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<p style="font-size: 90%; font-size: 90%;color: #899096;margin-top: -8px; margin-bottom: 0px;">
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<% if @message.content %>
|
||||
<%= ChatwootMarkdownRenderer.new(@message.content).render_message %>
|
||||
<% end %>
|
||||
<% if @message.attachments %>
|
||||
<% @message.attachments.each do |attachment| %>
|
||||
attachment [<a href="<%= attachment.file_url %>" _target="blank">click here to view</a>]
|
||||
<% 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 %>
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
<% if message.content.present? %>
|
||||
<hr style="border: 0; border-bottom: 1px solid #AEC3D5;"/>
|
||||
<% end %>
|
||||
This message contains <%= message.attachments.count > 1 ? 'attachments' : 'an attachment' %>.
|
||||
<% message.attachments.each do |attachment| %>
|
||||
<br />- View the attachment <a href="<%= attachment.file_url %>" _target="blank">here</a>.
|
||||
Attachments:
|
||||
<% message.attachments.each_with_index do |attachment, index| %>
|
||||
<% if index > 0 %><br /><% end %>
|
||||
<a href="<%= attachment.file_url %>" target="_blank"><%= attachment.file.filename.to_s %></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
<% if message.content %>
|
||||
<%= ChatwootMarkdownRenderer.new(message.content).render_message %>
|
||||
<% end %>
|
||||
<% if message.attachments %>
|
||||
<% if message.attachments.present? %>
|
||||
<p>Attachments:</p>
|
||||
<% message.attachments.each do |attachment| %>
|
||||
attachment [<a href="<%= attachment.file_url %>" _target="blank">click here to view</a>]
|
||||
<p><a href="<%= attachment.file_url %>" target="_blank"><%= attachment.file.filename.to_s %></a></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user