How can I tell AppMail how to use or not to use php’s Tidy extension?

How can I tell AppMail how to use or not to use php’s Tidy extension?

Please note that the setting from the code also works and has more weight than the one from the web interface, therefore if Tidy is enabled from the code but disabled from the web interface, then it will be disabled, but if it is disabled from the code and enabled from the web interface then it will remain disabled.

By default, AppMail makes use of PHP’s Tidy extension in order to clean and repair the email templates before their reach the parsing engine. This only works if your PHP install has the Tidy extension enabled. You can override the default behaviour by editing the file main-custom.php located in apps/common/config folder.
After you edit the file, it should look like:

return array(

    // application components
    'components' => array(
        'db' => array(
            'connectionString'  => 'mysql:host=localhost;dbname=__name__',
            'username'          => '__username__',
            'password'          => '__password__',
            'tablePrefix'       => 'mw_',
        ),
    ),

    // params
    'params' => array(

        /* START OUR CHANGES */
        // use tidy for templates parsing
        'email.templates.tidy.enabled' => false,

        // tidy default options
        'email.templates.tidy.options' => array(
            'indent'        => true,
            'output-xhtml'  => true,
            'wrap'          => 200
        ),
        /* END CHANGES */
    ),
);

As you can see, we have set: 'email.templates.tidy.enabled' => false, to disable Tidy. We can set it to true to enable it back again. You can also use pass additional tidy options by using the email.templates.tidy.options param.

    • Related Articles

    • Use 2FA in AppMail

      Two-factor authentication (2FA), sometimes referred to as two-step verification or dual-factor authentication, is a security process in which users provide two different authentication factors to verify themselves. This process is done to better ...
    • The IMAP extension is missing from your PHP installation.

      In case this kind of error isn’t pretty self-explanatory, your php instance doesn’t contain the imap extension. If you have access to command line, following commands should install php imap on your server: If you are on CentOS / RedHat / Fedora or ...
    • Guide to follow while creating your AppMail extensions

      The naming convention of the extension folder and extension init file for the extension remains the same, if your extension folder is called amazon-s3 your extension init file must be called AmazonS3Ext.php and must contain the class AmazonS3Ext ...
    • Setup guide for the “Subscribe by email” extension

      After you have installed the Subscribe by email extension, it’s time to set it up properly so that subscribers will be able to subscribe or unsubscribe by email directly, instead of going to a subscription/unsubscription form. If you go to the ...
    • Nginx server basic configuration for AppMail

      Please note that the below configuration is going to use php-fpm for what is worth. /etc/nginx/nginx.conf # For more information on configuration, see: # * Official English Documentation: https://nginx.org/en/docs/ # * Official Russian Documentation: ...