Emails

Parsing out Hidden Watermarks

Business Rule on sys_email table

(function executeRule(current, previous /*null when async*/) {

    //RegEx to find remove Re: in subject and anything after In-Reply-To:
            current.subject = String(current.subject).replace(/Re:+/i, "");
            current.headers = String(current.headers).replace(/In-Reply-To:<[^>]*>/ig, "");

    })(current, previous);

Summary

We had a client where an email would continually be marked as a reply with a watermark, even after the watermark had been removed. We found in this case, we needed to remove the “RE” in the subject and the “In-Reply-To” in the email header