Any template variable for name of an Account Plan

6 posts / 0 new
Last post
#1 Sat, 01/15/2011 - 07:41
adrianmak

Any template variable for name of an Account Plan

I created several account plans LSH-1000 ie 1GB data bandwidth limit LSH-2000 ie 2GB data bandwidth limit LSH-3000 ie 3GB data bandwidth limit

Is there any template variable for the name of an account plan selected so I can mentioned which account plan a customer requested in the email notification.

Sat, 01/15/2011 - 08:15
Locutus

There is a template variable to retrieve the plan ID, ${PLAN}, but that unfortunately will only give you the plan's numeric ID (which corresponds to files in /etc/webmin/virtual-server/plans).

I'm not sure if you can get Virtualmin templates to somehow extract the plan name from that file. Maybe it can use standard environment variables, or can call scripts and use their output as variable text... Eric or Joe or Jamie might be able to answer that. :)

If not, you'll have to write a little custom script to send the customer the appropriate email.

Sat, 01/15/2011 - 19:30 (Reply to #2)
adrianmak

Could I write some kind of script/plugin which can define a new template variable ?

The script/plugin will retrieve the plan name from the file as accordance to the plain id being choosen.

Sat, 01/15/2011 - 16:41
Locutus

Unfortunately I'm not sure about this...

I know that you can call a script before and after a domain/email address is created, but I don't know how to use environment variables set by that script in the template, or if that is even possible.

Hopefully Eric will see this topic and can answer it... Cause I'm personally interested in this too. :)

Until then, you might use the Custom fields feature, where you can manually enter a "Clear-text plan name" for each domain, and use the text you enter there in the email template. If you e.g. use planname as the custom field name, you can include it in templates as ${FIELD_PLANNAME}.

Sat, 01/15/2011 - 19:45 (Reply to #4)
adrianmak

I tried Custom fields feature but it just show ${FIELD_PLANNAME} in the email received.

Sun, 01/16/2011 - 09:27
Locutus

Check my example in my previous post again: In the "custom fields setup", you need to omit the "FIELD_".

Topic locked