Parallels H-Sphere Documentation Developer Guide

 

Using Variables in H-Sphere E-Mail Notifications

 
 

Related Docs:   XML Customization With Packages Customizing Notification List System E-Mail Notification Templates Editing E-Mail Notifications in CP

Last modified: 28 Dec 2007

 

WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.


H-Sphere e-mail notifications can be customized directly in CP admin interfacer in the Settings->E-Mail Notifications menu.

This document aims at advanced customization of these messages. It contains the description of basic notification variables.

Below is the table illustrating which variables are used in which notifications. The notifications are grouped and named according to their XML configuration file, user_emails.xml. The Tag column corresponds to the names of the notifications set in the tag attributes in user_emails.xml. In the Variables column, only variables specific to that particular notifications are listed. Standard variables are variables common for all notifications. Properties and methods for variables are listed below.

 

The List of Notification Variables

Tag Description Variables
Misc
LOST_PASSWORD Lost Password Message standard variables
OVERLIMIT Overlimit Notification suspend
over_limit_res
standard variables
SSH_NOTIFICATION Shell Access Notification result
subject
standard variables
VPS_INIT Virtual Private Server Initialization Notification vpsname
ips
ci
standard variables
Custom Domain Registration
ASYNC_CANCELED Async. Manager Canceled Transactions Not implemented
ASYNC_DONE Async. Manager Processed Transactions d
toolbox
CUSTOM_REGISTRAR_CONTACT_CHANGED User Information Changed Message registrant
tech
admin
billing
domain_name
renew_days
email_days
standard variables
CUSTOM_REGISTRAR_REGISTRATION Custom Domain Registration Request Message registrant
tech
admin
billing
domain_name
renew_days
email_days
standard variables
CUSTOM_REGISTRAR_RENEW Custom Renew Domain Registration Message registrant
domain_name
renew_days
email_days
period
standard variables
Managing Debtors
DEBT_DEL_NOT Deletion Warning bill
negative_date
current_date
suspend_date
delete_date
standard variables
DEBT_DEL_REASON Account Deletion bill
negative_date
current_date
suspend_date
delete_date
standard variables
DEBT_SUSP_NOT Suspension Warning bill
negative_date
current_date
suspend_date
delete_date
standard variables
DEBT_SUSP_REASON Account Suspension Not implemented
DEBT_WARN_NOTIFICATION Outstanding Balance Notification bill
negative_date
current_date
suspend_date
delete_date
standard variables
TRIAL_SUSP_REGISTER Trial Suspension Notification standard variables
Welcome Messages
FAILED_SIGNUP Failed Signup Notification failed_signups_q
accounts
lang
NEW_ACCOUNT Welcome Letter bi
ci
standard variables
NEW_MODERATED Welcome Letter For Moderated Accounts bi
ci
reseller_url
standard variables
NEW_MODERATED_CC Welcome Letter For Moderated Account with CC bi
ci
reseller_url
standard variables
TRIAL_MODERATED Welcome Letter For Trial/Moderated Account bi
ci
reseller_url
standard variables
TRIAL_REGISTER Trial Registration standard variables
Tax Exemptions
ACCOUNT_TEXEMPT_APPROVED Tax Exemption Approved Notification (Live Accounts) bi
ci
date
standard variables
ACCOUNT_TEXEMPT_REJECTED Tax Exemption Rejected Notification (Live Accounts) bi
ci
date
standard variables
MODERATED_TEXEMPT_APPROVED Tax Exemption Approved Notification (Moderated Accounts) bi
ci
date
request
standard variables
MODERATED_TEXEMPT_REJECTED Tax Exemption Rejected Notification (Moderated Accounts) bi
ci
date
request
standard variables
NEW_MODERATED_TEXEMPT Welcome Letter (Tax Exemption) bi
ci
reseller_url
standard variables
Domain Registration
DOMAIN_TRANSFER Domain Transfer Message domain
standard variables
REGISTRAR_EXPIRED_WARN Expired Domain Registration Notification osrs
standard variables
REGISTRAR_RENEW_WARN Domain Registration Renew Warning osrs
standard variables
Managing Trials
TRIAL_APPROACH_NOT Trial Expiry Warning current_date
delete_date
suspension_date
trial_days_till
standard variables
TRIAL_DEL_NOT Deletion Warning current_date
delete_date
suspension_date
trial_days_till
standard variables
TRIAL_DEL_REASON Account Deletion current_date
delete_date
suspension_date
trial_days_till
standard variables
TRIAL_SUSP_NOT Suspension Warning current_date
delete_date
suspension_date
trial_days_till
standard variables
Trouble Ticket System
INTERNAL_TICKET Internal Ticket standard variables
Accounting
ACCOUNTING_ERROR Accounting Error letter error
date
stack
error_subject
standard variables
INVOICE Order Confirmation entries
taxes
subtotal
total
reseller_url
standard variables
MONEY_BACK Money Back Notification standard variables
Suspend/Resume
RESUME Account Resumed Notification standard variables
SUSPEND Account Suspended Notification reason
standard variables

 

Standard Variables

Variable Description
accountThe instance of the Account object
userThe instance of the User object
planThe instance of the Plan object
toolboxThe instance of the Toolbox object
configValues from hsphere.properties
settingsCurrent reseller settings
langThe Lang object

 

Special Variables

Variable Description
suspendThe date when account will be suspended
over_limit_resThe list of overlimited resources: Traffic, Quota, SummaryQuota
resultThe result of the request (OK, REFUSED, DISABLED), used only in SSH_NOTIFICATION
subjectThe result description, used in SSH_NOTIFICATION
vpsnameVPS server name
ipsList of VPS server IPs
dThe instance of the AsyncDescriptor object, used only in ASYNC_DONE
registrantThe same as ContactInfo
techTech info
adminAdmin info
billingRegistrar Billing Info
domain_nameDomain name
renew_daysRenew domains that many days before domain expiration
email_daysWarn users about domain expiration that many days in advance
periodRenewal period, in years
billThe instance of the Bill object
negative_dateOutstanding balance date
current_dateCurrent date
suspend_dateThe date when account will be suspended
delete_dateThe date when account will be deleted
failed_signups_qFailed signups counter, only for FAILED_SIGNUP
accountsList of accounts with failed signup, only for FAILED_SIGNUP
bi The instance of the BillingInfo object
ciThe instance of the ContactInfo object
dateCurrent date
requestFake request object
reseller_urlReseller URL
suspension_dateThe date when the account will be suspended
trial_days_tillDays left till the end of the trial period
errorError message
stackJava stack trace
error_subjectError's short description
entriesThe list of bill entries
taxesList of taxes
subtotalThe total, without taxes
totalThe total, with taxes
reasonReason for suspension, used only in SUSPEND

 

Properties and Methods

Many variables used in e-mail notifications are instances of H-Sphere objects. Below is the table with the description of methods and properties of respective objects (in bold).

Property/Method Description
Account
idAccount ID
descriptionDescription
periodIdBilling period ID
biThe BillingInfo object
ciThe ContactInfo object
billThe Bill object
planThe Plan object
planIdPlan ID
receive_invoiceFlag indicating if the invoice is received
suspend_reasonReason for suspension
passwordPassword
loginLogin
trial_time_leftTime left from trial account creation
p_endBilling period end date
exhaustion_dateExhaustion date
createdAccount creation date
User
loginLogin
passwordPassword
reseller_idReseller ID
reseller_urlReseller's CP URL
reseller_context_urlReseller Context URL
prefixPrefix for databases
isdemoFlag indicating that the account is in demo mode
Plan
idPlan ID
descriptionDescription
reseller_idReseller ID
disabledFlag indicating that plan is disabled
isPromocodeApplicableFlag indicating if promocode is available
typePlan type
Toolbox
getInvoice(modId)Returns an Invoice object
calculateTaxes(total[,bi_id])Calculates taxes
currency(value)Returns a string with currency representation
numberToCurLocale(value,useGrouping)Converts a number to current locale
getPaymentLink(gateway, sbalance, prefix, account, description)Returns payment link
int2ext(ip)Converts internal IP to external
lt(val1,val2)Compares two variables. Returns 1 if val<val2, else 0
sub(val1,val2)Subtracts val2 from val1
mul(val1,val2)Multiplies val1 and val2
taxesThe list of taxes
displayBalance(balance)Returns a string with the balance
nowCurrent date
dateCurrent date
Traffic
trafficCurrent traffic
sizeTraffic limit
tt_typeTraffic type
text_trafficText representation of traffic amount
infoCurrent traffic status
start_dateDate when traffic calculation is started
Quota
limitMbQuota size, in MB
limitFilesLimit of used files
usedMbDisk space now in use, in MB
usedFilesUsed files counter
infoCurrent quota status
start_dateDate when disk usage calculation is started
SummaryQuota
limitMbDisk usage limit
usedMbCurrent disk usage, in MB
lastDayUsedMbThe last day usage, in MB
infoCurrent disk usage status
start_dateDate when disk usage calculation is started
short_start_dateDisk usage calculation starting date, short format
ContactInfo
first_nameFirst Name
last_nameLast Name
org_nameCompany Name
address1First address
address2Second address
address3Third address
cityCity
stateState
countryCountry
postal_codeZIP
phonePhone Number
faxFax number
emailE-Mail address
BillingInfo
idBilling contact info ID
bi_idBill ID
nameName
first_nameFirst Name
last_nameLast Name
org_nameCompany Name
address1First address
address2Second address
cityCity
stateState (US)
state2Other state (non-US)
countryCountry
postal_codeZIP
phonePhone number
faxFax number
emailE-mail address
reasonReason for suspension
typePayment type:
CC - credit card,
CHECK - check, TRIAL - trial account.
piThe PaymentInfo object
exemption_codeTax exemption code
negative_dateOutstanding balance date
PaymentInfo
numberCC number
hNumberHidden number
cvv_checkedFlag indicating if CVV is checked
expCC expiration date
exp_yearCC expiration year
exp_monthCC expiration month
exp_dayCC expiration day
start_date CC creation date
start_yearCC creation year
start_monthCC creation month
start_dayCC creation day
issue_noIssue number
nameCC name
expired Flag indicating that CC is expiried
info CC info
type CC type
fatts Failed Charge Attempts Counter
fatts_info Failed Charge Attempts Info
is_fatts_checkedFlag indicating that Fatts control is activated
AsyncDescriptor
user_idUser ID
userThe User object
ridResource ID
descriptionDescription
start_dateStart date
last_checkLast check
stateState
max_delayMaximum delay
intervalInterval
errorError message
error_codeError code
Bill
idBill ID
openedDate when the billing period was opened
closedDate when the billing period was closed
entriesList of billing entries
descriptionDescription
desc_planPlan description
desc_shortShort description
start_balanceStart of the billing period
end_balanceEnd of the billing period
debitsDebit
creditsCredit
changeDifference
amountAmount
subamountAmount without taxes
balanceBalance
creditCredit
customCreditCustom credit
negativeDateOutstanding balance
format_openedFormatted date when the billing period was opened
format_closedFormatted date when the billing period was closed
to_payNegative balance
taxesList of taxes
total_taxesTaxes, total
BillEntry
idBilling entry ID
bill_idBilling period ID
descriptionDescription
is_creditFlag indicating if credit is added
taxTax
amountAmount
balanceBalance
noteNote
typePayment type
canceledFlag indicating that billing entry is canceled
billing_info_idBilling Info ID
dateDate when the billing entry was added
format_dateFormatted date when the billing entry was added
Invoice
localized_totalThe total in local currency
totalThe total
subtotalThe total without taxes
entriesBilling entries
taxesThe list of taxes

 

Examples of Usage

1. Labels from language bundles

Labels from the hsphere_lang.properties language bundles are called by means the lang variable.

For example, the massmail.welcome_login label is called:

${lang.massmail.welcome_login}

In more complex cases, labels may contain arguments within their text, for example:

massmail.welcome_header = Dear {0} {1},

where the arguments {0} and {1} stand for a customer's first name and last name, respectively.

To call such labels with arguments:

${lang.massmail.welcome_header(account.ci.first_name,account.ci.last_name)}

Please refer to the description of account and ci.

2. Getting credit card information

The pi variable returns information about user credit card. For example, to get credit card number:

${account.bi.pi.number}


Related Docs:   XML Customization With Packages Customizing Notification List System E-Mail Notification Templates Editing E-Mail Notifications in CP



© Copyright 2017. Parallels Holdings. All rights reserved.