Skip to main content

Utilising & Troubleshooting Variables

Learn how to use and fix Variables.

Written by Maahi Islam
Updated over 3 weeks ago

Nested variables you can use

You can identify these different kinds of variables on TutorCruncher by going to your Email Definitions, editing a given email and scrolling down to the list of Available Variables. Secondary Variables will be listed below their corresponding primary variable, indented to the right and filtered grey.

This is an example of the Nested Variables which correspond to the primary variable ###{{ #student_recipient details }} - As per the example given above.

This is an example of the Nested Variables which correspond to the primary variable ######{{ #student_recipient details }} - As per the example given above.

Please note:

  • The logical parts of the template, the IF and IF NOT statements, must be opened and closed for the template to work. For instance, you cannot simply do ######{{#variable_to_check}} ..., you also include ######{{\variable_to_check}}.

  • If you have inserted the first part of an IF or IF NOT statement, the opening part, then you must include the second part, the closing part, before you close another. For instance, the following will not work:

######{{#first_variable_to_check}}    < Opening first IF statement...######{{#second_variable_to_check}}   < Opening second IF statement...######{{/first_variable_to_check}}    < Closing first IF statement...######{{/second_variable_to_check}}   < Closing second IF statement

Whereas this would:

######{{#first_variable_to_check}}    < Opening first IF statement...######{{#second_variable_to_check

Why your variables might not be working

Even if you have entered the right variable for a particular field, it may be the case that these aren't being reflected on the emails themselves. The reason for this may be that you have yet to frame these variables. Framing your variables is sometimes necessary in order to tell the system what it should be looking for. For example; if you were attempting to write a Job Confirmation Email to your Tutors, you may wish to let tutors know what the student's details are (name, address, their associated client, phone number, etc.). However, when taken alone, entering the variable ######{{ client_name }} will not return any results, because the system requires context within which to search for that information.

The way to provide this much-needed context is through "nesting" your variables, here's a quick run-through, using the example above as our guide.

  • In this example, we would want to nest our variable ######{{ client_name }} within a variable which tells the system that you are looking for the details of that particular student (a.k.a. Service Recipient).

  • How would we tell the system this? Simply by adding another variable before, in this case, that would be: ######{{ #student_recipient_details }}

  • Now that we have told the system to look for these ######{{ #student_recipient_details }}, it will come to the variable for ######{{ client_name }} and know exactly what it needs to look for, but what happens after that?

  • If left like this, the system will continue to look for the student's details for every other variable on the page, which is not what we want, so in order to structure our email properly, we will need to tell it to stop looking for the student's details at some point as well.

  • The way we do this is by writing another new variable, below ######{{ client_name }} which tells it to stop, this is written as ######{{ /student_recipient_details }}

  • Now the system knows where to start looking for the correct information: ######{{ #student_recipient_details }}

  • Where to look specifically for the information: ######{{ client_name }}

  • And when to stop looking for the correct information: ######{{ /student_recipient_details }}

  • This is how you nest your variables in order to keep them functioning properly.


​

Did this answer your question?