Jump to content

Email template conditional formula with configurable option


didier1

Recommended Posts

Hi, I am trying to display a certain information on my product welcoming email if client selected a particular configurable option in their order.

 

I tried

{if $service_config_options eq "Encryption WPA2 /Mac Address Filter"}

WPA

{else}

No WPA

{/if}

 

 

where "Encryption WPA2 /Mac Address Filter" is the name of my configurable option.

 

Problem : email is not generated. I think the condition eq is not really appropriate. I am more looking for :

 

{if $service_config_options is not NULL "Encryption WPA2 /Mac Address Filter"}

 

but not sure of the syntax.

 

thanks for your help

Link to comment
Share on other sites

what does it show if you just use {$service_config_options} in the email on an order where you had added the above config option?

 

it might be that you need to not use equals, but to search if your wanted phrase is stored in {$service_config_options}... possibly something along the lines of...

 

{if $service_config_options|strstr:"Encryption WPA2 /Mac Address Filter"}
WPA
{else}
No WPA
{/if}

Link to comment
Share on other sites

Hello,

1- if I just use : {$service_config_options}

 

I have 'Array' displayed in my email.

 

2- If I use {if $service_config_options|strstr:"Encryption WPA2 /Mac Address Filter"}

WPA

{else}

No WPA

{/if}

 

Email does not get send and whmcs page hangs after clickcing button send email.

 

Am I missing something ?

 

thanks

Link to comment
Share on other sites

Am I missing something ?

No, I was.... I suspected it might be an array, but hoped it wasn't!.. we'll have to check a specific part of the array for your string.

 

try putting {$service_config_options_html} in the email and see what that displays - forget about the if statement for now.

 

I found that @ http://forum.whmcs.com/showthread.php?39315-Email-template-help

Link to comment
Share on other sites

  • 2 weeks later...

Hello, with {$service_config_options_html} without any condition , email displayed nothing. Any idea why ?

 

- - - Updated - - -

 

Actually, my test client did not have configurable option. Sorry forthat. NOW I see the configurable option descrption / value chosen when ordering. So I am assuming I could start building mupy conditional structure with

 

If {$service_config_options_html} = xxx/yyy then zzz.

 

I will let you know how it goes. Thanks for the tips, at least now I have more element to work my way to a solution.

 

Didier

Link to comment
Share on other sites

Hello again, I had no success tonight configuring that. Here's my code :

 

{if $service_config_options_html eq "WPA: 1"}

WPA ON

{else}

WPA OFF

{/if}

 

--

When just puting {$service_config_options_html} , the email look like that : WPA: 1 ( WPA is the name of the configurable iption and : 1 id the number ordered )

 

Any guidance would be appreciated at this point.

 

Cheers

Link to comment
Share on other sites

  • 7 months later...

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