{% set pending_messages = guest.system_get_pending_messages %}
{% if pending_messages %}
<script>
    {% for message in pending_messages %}
        bb.msg('{{message}}');
    {% endfor %}
</script>
{% endif %}