ufshane Posted October 8, 2013 Share Posted October 8, 2013 It it possible to do use {$service_product_name} or even better the product ID in a conditional string in the order conformation email? For example: {if $service_product_name eq "Product name"} (or if we can use a string for product id instead) text for product 1 {else $service_product_name eq "Product name 2"} text for product 2 {else $service_product_name eq "Product name 3"} text for product 3 {/if} Is the above example doable specifically in the order confirmation email 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 8, 2013 Share Posted October 8, 2013 I don't believe that it is, I think you can only include the merge fields shown in the box at the bottom of the email template page. http://docs.whmcs.com/Email_Templates#Conditional_Displays if you could, then the code would be.... {if $service_product_name eq "Product name"} text for product 1 {elseif $service_product_name eq "Product name 2"} text for product 2 {elseif $service_product_name eq "Product name 3"} text for product 3 {/if} you could use this code in any of the welcome emails though... $service_id should work too - with the advantage being that if you ever renamed your products, the email templates wouldn't be affected. 0 Quote Link to comment Share on other sites More sharing options...
ufshane Posted October 8, 2013 Author Share Posted October 8, 2013 Hmm that's a shame 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 8, 2013 Share Posted October 8, 2013 i'm wondering if you can do it by searching {$order_details} instead - its output should effectively display the value of $service_product_name... {if $order_details|strstr:"Product name"} text for product 1 {if} if an order has one product, then this should work fine - if it contains multiple items and you are using specific text for each, then it could get messy... that's why it's easier to use the welcome emails! 0 Quote Link to comment Share on other sites More sharing options...
ufshane Posted October 8, 2013 Author Share Posted October 8, 2013 Doing it in the order confirmation fits better with the process since there is not an API available with what I am managing with this install... We will get by with it for now... optimally I wish there was a better way 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.