dimitrifrom31 Posted October 13, 2016 Share Posted October 13, 2016 Hi, With whmcs v5/6 I was using {$service_custom_field_instructions|nl2br} to include linebreaks for the solusvm custom field "instructions" as else it was writing everything on the same line. Now with v7 the welcome email is not sending with the following error: Smarty Error: Syntax error in template "mailMessage:mailMessage:plaintext" on line 26 "{$service_custom_field_instructions|nl2br}" modifier 'nl2br' not allowed by security setting How can this be worked around as without linebreaks the instructions are quite not readable. Thank you 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted October 13, 2016 Share Posted October 13, 2016 Hello dimitrifrom31, Thank you for your post on the community forums. WHMCS 7.0 introduces support for Smarty Security Policies. The default policies are to allow all PHP functionality in system templates but only a restricted predefined list of functions and modifiers in email templates. The nl2br function should be on the acceptable list however you may need to modify your own policy please refer to this support note for more assistance on updating your policy. 0 Quote Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted October 13, 2016 Author Share Posted October 13, 2016 I had no custom list set so I have no idea why I cannot use it. I tried to make a policy as follows but I still got the error: // Smarty custom email based template policy: $smarty_security_policy = array( 'mail' => array( 'php_functions' => array( 'nl2br', ), ), 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted October 17, 2016 WHMCS Support Manager Share Posted October 17, 2016 Hi, The code to add your your configuration.php file would be: // Smarty custom email based template policy: $smarty_security_policy = array( 'mail' => array( 'php_functions' => array( 'nl2br', ), ), ); 0 Quote Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted October 19, 2016 Author Share Posted October 19, 2016 Hi,The code to add your your configuration.php file would be: // Smarty custom email based template policy: $smarty_security_policy = array( 'mail' => array( 'php_functions' => array( 'nl2br', ), ), ); That's what I just tried again but it does not work: An Error OccurredEmail message rendered empty - please check the email message Smarty markup syntax 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted October 23, 2016 Share Posted October 23, 2016 Hi dimitrifrom31, Please open a support ticket so we can dig into this further for you. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.