How to check if a constant or a global variables is defined

In a distributed context, I would like to set on each satellites the domain of our mail2sms gateways in a constant or a global variable and use it in a NotificationCommand definition (in global-templates zone). In our case, not all satellites have a mail2sms gateway and for satellites without, I would like to use our main mail2sms gateway.
I’m the declaration of my notification_useremail variable of the NotificationCommand object, I’m looking for a way to test if the constant or global variables is defined to use it in this case, on fallback to default value if not.
I try with macro(“$SMSDomain$”) with a SMSDomain contants or global variables set in my satellites zones, but it seem to does not works (it’s always fallback to default domaine). Do you have any idea how I could do this ?

Thanks !

We’ve defined additional host templates for each site with its variables and added them to the hosts accordingly. We call them site templates and every host has its site specific variables.

Thank and yes, host template and variable always set could be a solution, but I hoping a solution without to have to use different template for each site. Their is no way to test if a variable is set or not ?