send_subscription_email

NAML documentation   Watch a video
   Usages of this macro
... in send_subscription_email.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<override_macro name="send_subscription_email" parameters="node_attr,text_part,html_part" requires="subscription">  
    <n.set_local_subscription
Macro
Parameters: subscription
.this_subscription
Binary
Namespace: SubscriptionNamespace
Parameters: do
/>  
    <n.set_local_node
Macro
Parameters: node
.node_attr/>  
    <n.block
Binary
Namespace: BasicNamespace
Parameters: do
.>  
        <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.local_subscription
Macro
Parameters: do
.user
Binary
Namespace: SubscriptionNamespace
Parameters: do
.reply_address_for
Binary
Namespace: UserNamespace
Parameters: node
.local_node
Macro
Parameters: do
/>  
                <from_name><n.local_node
Macro
Parameters: do
.owner
Binary
Namespace: NodeNamespace
Parameters: do
.name
Binary
Namespace: UserNamespace
Parameters: truncate
/> [via <n.root_node
Binary
Namespace: NabbleNamespace
Parameters: do
.subject
Macro
Requires: node
/>]</from_name>
                <subject.>       
                    <n.set_var
Binary
Namespace: BasicNamespace
Parameters: name, value
. name="subject">     
                        <n.regex_replace_all
Binary
Namespace: BasicNamespace
Parameters: pattern, text, replacement
 text="[n.local_node
Macro
Parameters: do
.subject
Macro
Requires: node
/]" pattern="(Re:)|(RE:)|(Re :)|(RE :)" replacement=""/>  
                    </n.set_var.>                     
  
                    <n.regex
Binary
Namespace: BasicNamespace
Parameters: pattern, text, do
. text="[n.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='subject'/]" pattern="(Re:)|(RE:)|(Re :)|(RE :)">  
                        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.find
Binary
Namespace: RegexNamespace
>  
                            <then>  
                                <n.regex_replace_all
Binary
Namespace: BasicNamespace
Parameters: pattern, text, replacement
 text ="[n.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='subject'/]" pattern="(Re:)|(RE:)|(Re :)|(RE :)" replacement =''/>                                   
                            </then>  
                            <else><n.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='subject'/></else>  
                        </n.if.find>  
                    </n.regex.>  
                      
                </subject.>    
                <text_part.text_part/>  
                <html_part.html_part/>
                <set_headers_for.local_node
Macro
Parameters: do
/>  
                <bounce_to.local_subscription
Macro
Parameters: do
.user
Binary
Namespace: SubscriptionNamespace
Parameters: do
.bounces_address
Binary
Namespace: UserNamespace
/>  
            </n.send>  
        </n.new_email.>  
    </n.block.>  
</override_macro>
Overrides default macro
... in email.naml
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<macro name="send_subscription_email" parameters="node_attr,text_part,html_part" requires="subscription">
    <n.set_local_subscription.this_subscription/>
    <n.set_local_node.node_attr/>
    <n.block.>
        <n.new_email.>
            <n.send>
                <to.local_subscription.user.user_email/>
                <to_name.local_subscription.user.name/>
                <from.local_subscription.user.reply_address_for.local_node/>
                <from_name><n.local_node.owner.name/> [via <n.root_node.subject/>]</from_name>
                <subject.local_node.subject/>
                <text_part.text_part/>
                <html_part.html_part/>
                <set_headers_for.local_node/>
                <bounce_to.local_subscription.user.bounces_address/>
            </n.send>
        </n.new_email.>
    </n.block.>
</macro>