digest email

NAML documentation   Watch a video
   Usages of this macro
... in digest email.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<override_macro name="digest email" requires="subscription,node_list">
    <n.set_local_subscription
Macro
Parameters: subscription
.this_subscription
Binary
Namespace: SubscriptionNamespace
Parameters: do
/>
    <n.filter_by
Macro
Requires: list
Parameters: filter
.both
Binary
Namespace: BasicNamespace
Parameters: condition1, condition2
 condition1="[n.local_subscription
Macro
Parameters: do
.user
Binary
Namespace: SubscriptionNamespace
Parameters: do
.can_view
Macro
Requires: user
Parameters: node_attr
.current_node
Binary
Namespace: NodeList
Parameters: do
/]" condition2="[n.local_subscription
Macro
Parameters: do
.user
Binary
Namespace: SubscriptionNamespace
Parameters: do
.is_in_group
Binary
Namespace: UserNamespace
Parameters: group
 group='Members' /]"/> 
    
    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.list_is_empty
Binary
Namespace: ListSequence
>
        <then>
            <n.new_email
Binary
Namespace: NabbleNamespace
Parameters: do
.>
                <n.send
Binary
Namespace: EmailNamespace
Parameters: cc, text_part, bcc, attachments, to_name, subject, from_name, html_part, set_headers_for, aol_part, bounce_to, from, to
>
                    <to.local_subscription
Macro
Parameters: do
.user
Binary
Namespace: SubscriptionNamespace
Parameters: do
.user_email
Binary
Namespace: UserNamespace
/>
                    <to_name.local_subscription
Macro
Parameters: do
.user
Binary
Namespace: SubscriptionNamespace
Parameters: do
.name
Binary
Namespace: UserNamespace
Parameters: truncate
/>
                    <from_name.root_node
Binary
Namespace: NabbleNamespace
Parameters: do
.subject
Macro
Requires: node
/>
                    <subject><n.local_subscription
Macro
Parameters: do
.node
Binary
Namespace: SubscriptionNamespace
Parameters: do
.subject
Macro
Requires: node
/> --- <t>Digest Email</t></subject>
                    <text_part.local_subscription
Macro
Parameters: do
.digest_text
Macro
Requires: subscription, node_list
/>
                    <html_part.local_subscription
Macro
Parameters: do
.digest_html
Macro
Requires: subscription, node_list
/>
                    <bounce_to.local_subscription
Macro
Parameters: do
.user
Binary
Namespace: SubscriptionNamespace
Parameters: do
.bounces_address
Binary
Namespace: UserNamespace
/>
                </n.send>
            </n.new_email.>        
        </then>
    </n.if.not.list_is_empty>
</override_macro>
Overrides default macro
... in email.naml
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<macro name="digest email" requires="subscription,node_list">
    <n.set_local_subscription.this_subscription/>
    <n.filter_by.local_subscription.user.can_view.current_node/>
    <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.>
</macro>