{% set mlogcontext = {
            'system': 'crewcall',
            'object_name': 'person',
            'message_type': 'PersonNote',
            'state': 'UNREAD',
            'external_id': app.user.id
    }
%}
<div id="personalmessages">
<h3>Messages to you</h3>
{% for note in sakonnin_messages.MessagesForContext(mlogcontext) %}
{% if is_granted('show', note) %}
<div id="personnote_{{ note.id}}">
<strong>{{ note.subject }}</strong>
<pre wrap>
{{ note.body }}
</pre>
<a href="{{ path('message_state', {'access': 'ajax', 'id': note.id, 'state': 'ARCHIVED'}) }}" onClick="$('#personnote_{{ note.id}}').hide(); return false;"><button>Read it!</button></a>
</div>
{% endif %}
{% endfor %}
</div>

{% set mlogcontext = {
            'system': 'crewcall',
            'object_name': 'person',
            'message_type': 'PersonNote',
            'state': 'UNREAD',
            'external_id': app.user.id
    }
%}
<div id="personalmessages">
<h3>Messages to you</h3>
{% for note in sakonnin_messages.MessagesForContext(mlogcontext) %}
{% if is_granted('show', note) %}
<div id="personnote_{{ note.id}}">
<strong>{{ note.subject }}</strong>
<pre wrap>
{{ note.body }}
</pre>
<a href="{{ path('message_state', {'access': 'ajax', 'id': note.id, 'state': 'ARCHIVED'}) }}" onClick="$('#personnote_{{ note.id}}').hide(); return false;"><button>Read it!</button></a>
</div>
{% endif %}
{% endfor %}
{% for note in sakonnin_messages.MessagesForUser(app.user, {'state': 'UNREAD'}) %}
<div id="personnote_{{ note.id}}">
<strong>{{ note.subject }}</strong>
<pre wrap>
{{ note.body }}
</pre>
<a href="{{ path('message_state', {'access': 'ajax', 'id': note.id, 'state': 'ARCHIVED'}) }}" onClick="$('#personnote_{{ note.id}}').hide(); return false;"><button>Read it!</button></a>
</div>
{% endfor %}
</div>

Add messages direct to user.
Add messages direct to user.
