Login  Register

RE: Instant Email - new topics only

Posted by Pedro on Jan 06, 2014; 7:37pm
URL: https://support.nabble.com/Instant-Email-new-topics-only-tp7588908p7589003.html

Please, try this:
<override_macro name="save_field_values">
    <n.if.equal value1="save-subscription" value2="[n.action_parameter/]">
        <then>
            <n.page_node.visitor_subscription.save
                to="[n.subscription_to_field.value/]"
                type="[n.subscription_type_field.value/]"
            />            
            <n.if.equal value1="[n.subscription_to_field.value/][n.subscription_type_field.value/]" value2="CHILDRENINSTANT">
                <then><n.page_node.descendants/></then>
            </n.if.equal >            
            <n.redirect_to.subscription_saved_url/>            
        </then>
    </n.if.equal>
</override_macro>


<macro name='descendants' requires='node'>    
    <n.this_node.descendant_apps_list.>
        <n.loop.>         
            <n.current_node.visitor_subscription.save
                to="[n.subscription_to_field.value/]"
                type="[n.subscription_type_field.value/]"
            />
        </n.loop.>
    </n.this_node.descendant_apps_list.>
</macro>
When the user save his subscription as  "Receive new topics only" and "Individual emails", the system goes through all descendants apps and subscribe the user in each one.
My test forum.