Skip to content

Instantly share code, notes, and snippets.

@pranavrajs
Last active July 11, 2022 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pranavrajs/df631b0bda4504f8d655fa75a97dadc8 to your computer and use it in GitHub Desktop.
Save pranavrajs/df631b0bda4504f8d655fa75a97dadc8 to your computer and use it in GitHub Desktop.
Show Conversation details
<p><b>Inbox Name is:</b> {% inbox.name %}</p>
<p><b>Previous messages:</b></p>
{% for chat_message in conversation.recent_messages %}
<div>
<h4 style="margin: 0;">
{% if chat_message.sender == user.available_name %}
You
{% else %}
{{chat_message.sender}}
{% endif %}
</h4>
</div>
<div 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 %}
</div>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment