Jump to content

FULL List of conditional Variables available in email templates


bluesteam

Recommended Posts

Hello,

This might seem obvious to some but for some reason I can't find the full list.

I am looking at creating some custom email templates and need to use conditional variables. 

The table below showing the Available Merge Fields does not include ALL possible variables available.

How would I know WHAT variables are available to me that are not in the bottom table to use in the template?

Thanks

Brett

Link to comment
Share on other sites

Hi Brett,

19 minutes ago, bluesteam said:

This might seem obvious to some but for some reason I can't find the full list. 

that's because a full public list doesn't exist - I daresay WHMCS wouldn't touch doing it themselves as it would soon become out of date and they would not want to commit to keeping it updated.

19 minutes ago, bluesteam said:

How would I know WHAT variables are available to me that are not in the bottom table to use in the template?

the usual way would be to add {debug} to the email template in question; send a test message using that template; view the sent email via the client summary -> emails tab - click on the email and it should open in a popup window and more importantly, the debug popup window will also appear with a list of available variables and arrays... and you should then be able to know which variables are available for your conditional statements.

Link to comment
Share on other sites

So I created a test template and simply added {debug} with some random text.

I went to the test account I have on my WHMCS and went to the blank product for the test account and sent an email using that template.

but I notice that again, not all variables are shown. 

For example, on the SpamExperts Welcome email template, there is a variable called $configuration_required but on the test hosting product, when viewing the debug info, that variable is not listed.

So I suspect the debug will only show the relevant variables to that specific product type when viewing the debug info.

I have to now find a way to add a dummy SpamExperts product and send another test using that test template to see if my theory is correct.

Edited by bluesteam
Link to comment
Share on other sites

Ok, So I managed to create a fake order on my test account for the SpamExperts product.  I then tested my template and lo-and-behold, that $configuration_required variable?

NOT THERE!

So that doesn't help me again!  sigh....how the heck is one supposed to know what all variables are available if they don't tell us.

sheesh!  this is like farting against thunder!

Edited by bluesteam
Link to comment
Share on other sites

20 minutes ago, bluesteam said:

Crazy that in order to know what we can use, we have to jump through hoops, do backflips and sell our firstborn...

no doubt MarketConnect will soon have an option to sell your firstborn at highly competitive prices. 🙂

7 minutes ago, bluesteam said:

So I created a test template and simply added {debug} with some random text.

I would have added {debug} to the template you want to add the conditional to, rather than create a custom one...

7 minutes ago, bluesteam said:

but I notice that again, not all variables are shown.  

For example, on the SpamExperts Welcome email template, there is a variable called $configuration_required but on the test hosting product, when viewing the debug info, that variable is not listed. 

So I suspect the debug will only show the relevant variables to that specific product type when viewing the debug info.

the debug window should show the arrays relevant to the email template type, e.g general, invoice, product etc e.g if you add a {debug} to an invoice template, the arrays available will be relevant to invoicing.... whereas, if you do the same to a welcome email, there will be no invoicing details, but a lot of service related information.

10 minutes ago, bluesteam said:

I have to now find a way to add a dummy SpamExperts product and send another test using that test template to see if my theory is correct.

the MarketConnect welcome emails might have a lot of additional variables added in the background that a new custom (unrelated to MC) probably won't have - I suspect to test this correctly, you would have to add the {debug} to the SpamExperts welcome template and make an order... of course, as we discussed in another thread, the MC welcome emails are often only sent when there is a failure - so this could be a bugger to test.

9 minutes ago, bluesteam said:

Ok, So I managed to create a fake order on my test account for the SpamExperts product.  I then tested my templated and lo and behold that $configuration_required variable

as I say because you're trying it in a custom email template - I daresay that $configuration_required variable is only available to the MarketConnect welcome emails - there is probably code running in the core program that is adding that variable specifically to the SpamExperts / Weebly email templates.

16 minutes ago, bluesteam said:

So that doesn't help me again!  sigh....how the heck is one supposed to know what all variables are available if they don't tell us.

do you see why I tend not to bang my head against a brick wall trying to work out how some hidden feature in WHMCS works any more - it's often not worth the hassle. headshake.gif

I suspect if you could add debug to the SpamExperts welcome email template and make an order (and perhaps make it fail to generate the email), then the popup window would show $configuration_required - i'd be surprised if it wasn't there to be honest.

now if you wanted to recreate $configuration_required in a custom template, then you're into the realms of writing mergefield hooks and trying to figure out under what conditions $configuration_required values exist... i'm guessing that it's true if autoconfig has failed.. so possibly if the product status is set at pending in tblhosting - but that's just a wild guess.. only WHMCS will know what's going on with MarketConnect in the background.

Link to comment
Share on other sites

Quote

I would have added {debug} to the template you want to add the conditional to, rather than create a custom one...

That would require that I actually activate the order and I would prefer not to. That is why I created a custom one.

Quote

but I notice that again, not all variables are shown.  

For example, on the SpamExperts Welcome email template, there is a variable called $configuration_required but on the test hosting product, when viewing the debug info, that variable is not listed. 

So I suspect the debug will only show the relevant variables to that specific product type when viewing the debug info.

You are correct.  but what is does NOT show are any variables pertaining to the addons of that product in question.  addon variables are non-existent and it's the addon variables I'm trying to get access to.

Quote

the MarketConnect welcome emails might have a lot of additional variables added in the background that a new custom (unrelated to MC) probably won't have - I suspect to test this correctly, you would have to add the {debug} to the SpamExperts welcome template and make an order... of course, as we discussed in another thread, the MC welcome emails are often only sent when there is a failure - so this could be a bugger to test.

Correct, turning in to a complete bugger! 

 

Link to comment
Share on other sites

14 minutes ago, bluesteam said:

You are correct.  but what is does NOT show are any variables pertaining to the addons of that product in question.  addon variables are non-existent and it's the addon variables I'm trying to get access to.

so is this a hosting product with a MarketConnect service (e.g SpamExperts) as a product addon ?

you could try setting a welcome email for the product addon (as previously discussed it would have to be custom, and not MC) and it would be sent once the addon had been activated.

Link to comment
Share on other sites

4 minutes ago, brian! said:

so is this a hosting product with a MarketConnect service (e.g SpamExperts) as a product addon ?

you could try setting a welcome email for the product addon (as previously discussed it would have to be custom, and not MC) and it would be sent once the addon had been activated.

Correct, the problem is this.  the welcome email goes out without an issue.  BUT...if the client purchases Outgoing Filtering and Email Archiving as addons, then the supposed "FULL AUTOMATION" (that does not actually exist with MC), does not enable the Email Archiving automatically and it does not configure outgoing users or set the SPF record.

I want to inform my clients that when they purchase the Outgoing or Archiving that they need to log n to their dashboard and enablethe archiving as well as create the outgoing users.

so this will have to be based on the fact that they have purchased the actual outgoing or archiving addons.

Edited by bluesteam
Link to comment
Share on other sites

18 minutes ago, bluesteam said:

Correct, the problem is this.  the welcome email goes out without an issue.

the welcome email for the main product - custom template or MC, or welcome email for the addon ??

19 minutes ago, bluesteam said:

I want to inform my clients that when they purchase the Outgoing or Archiving that they need to log n to their dashboard and enable the archiving as well as create the outgoing users.

does the invoice email list either in the order summary? if so, then it would be an option to put this info in the invoice email... not great for the end user experience, but if the welcome email doesn't have those details, then you're left with either adding the instruction generically in the welcome email template (e.g every purchaser of that product will see it), or you go down the road of additional coding to identify if either addon is in the order.

Link to comment
Share on other sites

10 minutes ago, brian! said:

the welcome email for the main product - custom template or MC, or welcome email for the addon ??

does the invoice email list either in the order summary? if so, then it would be an option to put this info in the invoice email... not great for the end user experience, but if the welcome email doesn't have those details, then you're left with either adding the instruction generically in the welcome email template (e.g every purchaser of that product will see it), or you go down the road of additional coding to identify if either addon is in the order.

The default SpamExperts welcome email is used for the addon purchase.

Yes it lists the addon in the order summary on the invoices.  but I don't want to add that info on the invoice.  The client would not even read it.

It needs to be in the welcome email.

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