Login  Register

RE: Remove multiple RE:'s in email reply

Posted by Pedro on Dec 16, 2014; 8:41pm
URL: https://support.nabble.com/Remove-multiple-RE-s-in-email-reply-tp7592885p7593203.html

Please, test this override:
<override_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.comment>
        Changed to include subcategory in from name.  
        Added SU! in front of subject line
        Removed extra SU!s in subject line
    </n.comment>
    <n.block.>
        <n.new_email.>
            <n.set_header name="Sender" value="[n.local_subscription.user.reply_address_for.local_node/]"/>
            <n.set_header name="List-Id" value="forum.sudsol.org"/>
            <n.set_header name="Mailing-List" value="list [n.local_subscription.user.reply_address_for.local_node/]; contact slb@sudsol.org"/>
            <n.set_header name="Precedence" value="bulk"/>
            <n.send>
                <to.local_subscription.user.user_email/>
                <to_name>SUDSOL Group</to_name>
                <from.local_subscription.user.reply_address_for.local_node/>
                <from_name>SUDSOL [<n.local_node.owner.name/>] via <n.local_node.get_app_node.subject/></from_name>
                <subject.>     
                    <n.set_var. name="subject">   
                        SU!: <n.regex_replace_all text="[n.local_node.subject/]" pattern="SU!: " replacement=""/>
                    </n.set_var.>                   

                    <n.regex. text="[n.var name='subject'/]" pattern="Re: ">
                        <n.if.find>
                            <then>
                                Re:  
                                <n.regex_replace_all text = "[n.var name='subject'/]" pattern="Re:" replacement = ''/>                                 
                            </then>
                            <else><n.var name='subject'/></else>
                        </n.if.find>
                    </n.regex.>
                    
                </subject.>  
                <text_part.text_part/>
                <html_part.>
                    <n.regex_replace_all text="[n.local_node.html_part/]" pattern="\u00a0" replacement=" "/>
                </html_part.>
                <set_headers_for.local_node/>
                <bounce_to.local_subscription.user.bounces_address/>
            </n.send>
        </n.new_email.>
    </n.block.>
</override_macro>
My test forum.