Indentation Is Reflected as Spaces in Custom Functions or Message Templates
You may have encountered issues where whitespace and newlines in HTML code affect the browser's display. To avoid this problem, you would need to write all tags in the template consecutively. However, this makes the template very difficult to read and manage.
By enclosing content within {strip}{/strip}
tags, you can remove unnecessary whitespace and newlines at the beginning and end of each line, so please use this feature.
Example of a message template:
{strip}
{assign_member_detail var='varname' member_id=$smarty.session.member_id assign_group_flg=true}
{foreach from=$varname.arrGroup_nm key=key item=groupName}
{if $groupName == "Administrator"}
{assign var=g_name value=$groupName}
{/if}
{/foreach}
{/strip}
RCMS-X-SUBJECT: An inquiry has been received from a member of {$g_name}.
Example of a custom function:
{strip}
{if $log_history.pageInfo.totalCnt == 1}
{capture name=mail_body}
A login from a new IP address has been detected.
Please verify if it was you.
IP Address: {$current_log.login_history_list[1].ip_address}
Date and Time: {$current_log.login_history_list[1].login_ymdhi}
Admin Panel URL: {$smarty.const.ROOT_MNG_URL}/management/
{/capture}
{sendmail
var='result'
to=$smarty.session.email
subject="Login detected from a new IP address."
contents=$smarty.capture.mail_body}
{logger
msg1="Login detected from a new IP address."
msg2=$current_log.login_history_list[1]}
{/if}
{/strip}
tip
For more details about strip, refer to Kuroco Documentation on Smarty Plugins.
Support
If you have any other questions, please contact us or check out Our Slack Community.