Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Conversation history in email notifications (#3414)
Display recent messages in the notification email when a new conversation is created. Fixes: #2041
- Loading branch information
1 parent
6a98a81
commit bfcde9b
Showing
3 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
class InboxDrop < BaseDrop | ||
def name | ||
@obj.try(:name) | ||
end | ||
end |
30 changes: 26 additions & 4 deletions
30
...ailers/agent_notifications/conversation_notifications_mailer/conversation_creation.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
<p>Hi {{user.available_name}}</p> | ||
|
||
|
||
<p>Time to save the world. A new conversation has been created in {{ inbox.name }}</p> | ||
|
||
<p> | ||
Click <a href="{{ action_url }}">here</a> to get cracking. | ||
A new conversation (<a href="{{ action_url }}">#{{conversation.display_id}}</a>) has been created in {{ inbox.name }}. | ||
<strong>{{ conversation.contact_name }}</strong> wrote: | ||
</p> | ||
|
||
{% for chat_message in conversation.recent_messages %} | ||
<div> | ||
{% if chat_message.sender == user.available_name %} | ||
<h4 style="margin: 0;">You</h4> | ||
{% else %} | ||
<h4 style="margin: 0;">{{chat_message.sender}}</h4> | ||
{% endif %} | ||
</div> | ||
|
||
<div> | ||
<p 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 chat_message.content %} | ||
{{chat_message.content}} | ||
{% endif %} | ||
|
||
{% if chat_message.attachments %} | ||
{% for attachment in chat_message.attachments %} | ||
Attachment [<a href="{{ attachment }}" _target="blank">Click here to view</a>] | ||
{% endfor %} | ||
{% endif %} | ||
</p> | ||
</div> | ||
{% endfor %} |