Added check for FlexMailer
This conditional wrapper is set in place to keep from affecting the use of Mosaico message templates, with mosaicomsgtpl in CiviRules or with PrettyWorkflowMessages for system messages. With out this conditional, the code tries to re-run the template through Smarty, but at this point it has already been run through Smarty. If the message is coming from FlexMailer, then this needs to process as that was the intended purpose of this extension. To allow Mosaico in mailings while using Smarty.
Related issue #1
I ran tests with using a new Mailing and Mosaico template and Smarty was processed ok. When using CiviRule and Mosaico message template, or system message using a Mosaico message template were processed without the duplicate Smarty processing.