Jump to content

Solusvm instructions in welcome emails and line breaks


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 Occurred

Email message rendered empty - please check the email message Smarty markup syntax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated