digest email.naml

<override_macro name="digest email" requires="subscription,node_list">
    <n.set_local_subscription.this_subscription/>
    <n.filter_by.both condition1="[n.local_subscription.user.can_view.current_node/]" condition2="[n.local_subscription.user.is_in_group group='Members' /]"/> 
    
    <n.if.not.list_is_empty>
        <then>
            <n.new_email.>
                <n.send>
                    <to.local_subscription.user.user_email/>
                    <to_name.local_subscription.user.name/>
                    <from_name.root_node.subject/>
                    <subject><n.local_subscription.node.subject/> --- <t>Digest Email</t></subject>
                    <text_part.local_subscription.digest_text/>
                    <html_part.local_subscription.digest_html/>
                    <bounce_to.local_subscription.user.bounces_address/>
                </n.send>
            </n.new_email.>        
        </then>
    </n.if.not.list_is_empty>
</override_macro>