Files
leadchat/app/views/mailers/conversation_reply_mailer/reply_with_summary.html.erb
Sojan Jose 3da26ee025 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>
2025-04-15 23:43:12 -07:00

33 lines
1.3 KiB
Plaintext

<p>Hi <%= @contact.name %>,</p>
<p>You have new messages on your conversation.</p>
<% @messages.each do |message| %>
<tr>
<td>
<b><%= message.incoming? ? 'You' : message.sender&.available_name || message.sender&.name || 'Bot' %></b>
</td>
</tr>
<tr>
<td style="padding: 0px 16px; margin: 4px 0 8px 0; background: #F5FAFF; border-radius: 5px; display: inline-block; font-family: 'Helvetica Neue',Tahoma,Arial,sans-serif; text-align: start; unicode-bidi: plaintext;">
<% if (message.content_type == 'input_csat' && message.message_type == 'template') %>
<p>Click <a href="<%= message.conversation.csat_survey_link %>" _target="blank">here</a> to rate the conversation.</p>
<% elsif message.content.present? %>
<%= ChatwootMarkdownRenderer.new(message.content).render_message %>
<% end %>
<% if message.attachments.count.positive? %>
<p>
<% if message.content.present? %>
<hr style="border: 0; border-bottom: 1px solid #AEC3D5;"/>
<% end %>
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 %>
</td>
</tr>
<% end %>