Jump to content

Question about excess whitespace when using multiple conditionals in custom emails.


Recommended Posts

I am having trouble with about a paragraph of whitespace appearing in email sent from our WHMCS custom emails. This happens when more than one conditional is used to display different options. The conditional below, when it arrives in the mailbox of our test account has a very large amount of whitespace between the 2 sections:
Access Credentials
=============================

Windows Server has been installed and Remote Desktop is enabled:
IP Address/Host: {$service_dedicated_ip}
Username: Administrator
Administrator password: {$service_password}
{foreach from=$service_config_options item=configoption}
{if $configoption.option eq "IPMI KVM"}{if $configoption.value eq "Yes"}
IPMI Details
=============================
IPMI IP Address: {$service_custom_field_ipmiipaddress}
IPMI Username: {$service_custom_field_ipmiusername}
IPMI Password: {$service_custom_field_ipmipassword}
{else}
{/if}
{/if}
{/foreach}

Does anyone have a solution?

Link to comment
Share on other sites

15 hours ago, RyanCo said:

Does anyone have a solution?

merge the two if statements, drop one of the closing IFs and the else (assuming there is nothing after the else you haven't removed above)... ?

Access Credentials
=============================
Windows Server has been installed and Remote Desktop is enabled:
IP Address/Host: {$service_dedicated_ip}
Username: Administrator
Administrator password: {$service_password}
{foreach from=$service_config_options item=configoption}
{if $configoption.option eq "IPMI KVM" && $configoption.value eq "Yes"}
IPMI Details
=============================
IPMI IP Address: {$service_custom_field_ipmiipaddress}
IPMI Username: {$service_custom_field_ipmiusername}
IPMI Password: {$service_custom_field_ipmipassword}
{/if}
{/foreach}
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