How to add user's email address to agent's email notification?

You can add user's email address into agents notifications using this line of code:


{% if notification.user.is_staff and notification.topic.author.email %}<p>Email: {{notification.topic.author.email}}</p>{% endif %}

So, to apply it open your "New topic" notification template and insert something like this:

{% if notification.topic.status.name %}<p align="right">
    <span style="background-color:#{{notification.topic.status.color}};color:#ffffff;padding:5px;"><strong>{{notification.topic.status.name}}</strong></span>
</p>{% endif %}
<p>Dear {{notification.user.name}},</p>
<p>New topic has been posted by {{notification.topic.author.name}}.</p>
{% if notification.user.is_staff and notification.topic.author.email %}<p>Email: {{notification.topic.author.email}}</p>{% endif %}
{% ue_notification_frame label="Click here to open topic" label_url=notification.url header=notification.topic.header text=notification.topic.description %}

Is this article helpful for you?