Changing Account Mail Templates

Changing Account Mail Templates

Mail templates are specified on user account level. They will be applied to all underlying reseller accounts unless explicitly overriden by reseller.

The following templates can be customized in DNP:

  • User Account Summary Information
  • Hosting Space Summart Information
  • Password Reminder

Common Template Engine Notes

  • DNP uses Ader Template engine to render all system template. Please see this page for more information about template engine library and its complete syntax: http://www.adersoftware.com/index.cfm?page=templateEngine2 
  • If you need to render # (sharp) symbol, for example HTML color value, it should be written as ## (double sharp), because # is reserved symbol in template engine.
  • All template engine processing tags ("ad:if", "ad:foreach", etc.) should be well-formed:
    • Have closing tag for each corresponding opening tag
    • All tag attributes should be surrounded with double quotes.
    • All tag names should be written in lower case.

User Account Summary Information Template

To change this template login under "serveradmin" or other account with reseller privileges.

On right panel of user account home page click "Mail Templates" link:

templates_account_home.PNG

Mail Templates settings page will appear:

templates_settings_home.PNG

Click "User Account Summary Letter" link:

templates_user_summary.PNG

Update "From", "CC", "Subject", both HTML and Text templates and click "Save" button to save changes.

User Account Template Variables

The following variables and constructs are supported in "Subject", "HTML Body" and "Text Body" templates:

#Signup# - is equal to "true" if the letter is sent during user account creation; otherwise when user re-sends the letter it is "false".

Can be used in the template as following:

 

<ad:if test="#Signup#">
This content will be included in the summary during signup only.
</ad:if>

#user# - account owner. It is a complex structure with the following available fields:

  • Username (string)
  • Password (string)
  • Email (string)
  • SecondaryEmail (string)
  • FirstName (string)
  • LastName (string)
  • FullName (string)
  • Address (string)
  • City (string)
  • Country (string)
  • State (string)
  • Zip (string)
  • PrimaryPhone (string)
  • SecondaryPhone (string)
  • Fax (string)
  • InstantMessenger (string)
  • IsDemo (bool)
  • IsPeer (bool)
  • HtmlMail (bool)
  • Created (DateTime)
  • Changed (DateTime)
  • RoleId (int)

In templates it can be used as following:

Hello, #user.FullName#
Your registered e-mail address is: #user.Email#

#reseller# -  host account. It is a complex structure with the same fields as "user" one.

#Spaces# - the collection of hosting spaces for the account. Each item in the collection is a complex structure with the following fields:

  • PackageId (int)
  • PlanId (int)
  • PackageName (string)
  • PurchaseDate
  • StatusId (int)

In the templates collection can be iterated as following:

 

You have the following spaces under your account:

<ad:foreach collection="#Spaces#" var="Space" index="i">
<h2>#Space.PackageName#</h2>
</ad:foreach>

#Plans# - the dictionary (key-value pairs) of hosting plans. Each key in #Plans# dictionary is PlanId of hosting plan and each value is a complex structure with the following fields:

  • PlanId (int)
  • PlanName (string)
  • PlanDescription (string)
  • SetupPrice (decimal)
  • RecurringPrice (decimal)
  • RecurrenceUnit (int)
  • RecurrenceLength (int)

Both #Spaces# and #Plans# collections can be used together in a single loop as shown below (corresponding space plan is referenced by PlanId):

 

The following hosting spaces have been created under your account:


<ad:foreach collection="#Spaces#" var="Space" index="i">
Hosting space name: #Space.PackageName#
Hosting plan name: Hosting Plan: #Plans[Space.PlanId].PlanName#
</ad:foreach>

#SpaceContexts# - the dictionary (key-value pairs) of hosting space contexts for all spaces in #Spaces# collection. Each key in #SpaceContexts# dictionary is PackageId of hosting space and each value is a complex structure with the following fields:

  • Package - hosting space details. It is a complex structure with the fields similar to item in #Spaces# collection.
  • Groups - dictionary with resource groups available in hosting space. Key is the name of the resource group and value is a complex structure with the following fields:
    • GroupId (int)
    • GroupName (string)
    • Enabled (bool) - always true for space context groups
    • CalculateDiskSpace (bool)
    • CalculateBandwidth (bool)

      The following group names are currently supported:
    • OS
    • Web
    • FTP
    • Mail
    • MySQL4
    • MySQL5
    • DNS
    • Statistics
    • SharePoint
    • MsSQL2000
    • MsSQL2005
    • MsSQL2008
  •  Quotas  - dictionary with hosting space quotas. Key is the name of the quota and value is a complex structure with the following fields:
    • QuotaName (string)
    • QuotaAllocatedValue (int) - the maximum number of items (bandwidth in MB, disk space in MB, web sites, FTP accounts, etc.) for this quota. "-1" if unlimited.
    • QuotaUsedValue (int) - the number of items (bandwidth in MB, disk space in MB, web sites, FTP accounts, etc.) created for this quota.

      The following quota names are currently supported:
    • OS.Diskspace
    • OS.Bandwidth
    • OS.Domains
    • OS.SubDomains
    • OS.ODBC
    • OS.FileManager
    • OS.AppInstaller
    • OS.ExtraApplications
    • OS.ScheduledTasks
    • OS.ScheduledIntervalTasks
    • OS.MinimumTaskInterval
    • Web.Sites
    • Web.Asp
    • Web.AspNet11
    • Web.AspNet20
    • Web.Php4
    • Web.Php5
    • Web.Perl
    • Web.Python
    • Web.CgiBin
    • Web.SecuredFolders
    • Web.SharedSSL
    • Web.Redirections
    • Web.HomeFolders
    • Web.VirtualDirs
    • Web.FrontPage
    • Web.Security
    • Web.DefaultDocs
    • Web.AppPools
    • Web.Headers
    • Web.Errors
    • Web.Mime
    • ftp://ftp.accounts/
    • Mail.Accounts
    • Mail.MaxBoxSize
    • Mail.Forwardings
    • Mail.Groups
    • Mail.MaxGroupMembers
    • Mail.Lists
    • Mail.MaxListMembers
    • MySQL4.Databases
    • MySQL4.Users
    • MySQL4.Backup
    • MySQL5.Databases
    • MySQL5.Users
    • MySQL5.Backup
    • DNS.Editor
    • Stats.Sites
    • SharePoint.Sites
    • SharePoint.Users
    • SharePoint.Groups
    • MsSQL2000.Databases
    • MsSQL2000.Users
    • MsSQL2000.MaxDatabaseSize
    • MsSQL2000.Backup
    • MsSQL2000.Restore
    • MsSQL2000.Truncate
    • MsSQL2005.Databases
    • MsSQL2005.Users
    • MsSQL2005.MaxDatabaseSize
    • MsSQL2005.Backup
    • MsSQL2005.Restore
    • MsSQL2005.Truncate
    • MsSQL2008.Databases
    • MsSQL2008.Users
    • MsSQL2008.MaxDatabaseSize
    • MsSQL2008.Backup
    • MsSQL2008.Restore
    • MsSQL2008.Truncate 

All dictionaries support the following methods:

  • bool ContainsKey(keyName) - allows to check if specified key-value pair exists in the dictionary
  • object [keyName] - allows to get specified value from dictionary by its key

Some examples of using "Groups" and "Quotas" dictionaries:

1. To check if "MS SQL 2000" resource exists in the spaces:

 

<ad:foreach collection="#Spaces#" var="Space" index="i">
Space name: #SpaceContexts[Space.PackageId].PackageName#


<ad:if test="#SpaceContexts[Space.PackageId].Groups.ContainsKey("MsSQL2000")#">
You have an ability to create MS SQL 2000 databases!
</ad:if>

2. To show how many MySQL 4 databases and database users are allocated within each space:

 

<ad:foreach collection="#Spaces#" var="Space" index="i">
Space name: #SpaceContexts[Space.PackageId].PackageName#


<ad:if test="#SpaceContexts[Space.PackageId].Groups.ContainsKey("MySQL4")#">
Databases: #SpaceContexts[Space.PackageId].Quotas["MySQL4.Databases"]#
Users: #SpaceContexts[Space.PackageId].Quotas["MySQL4.Users"]#
<ad:else>
You do not have MySQL 4 resource in this space!
</ad:if>

Space Summary Information Template

To change this template login under "serveradmin" or other account with reseller privileges.

On right panel of user account home page click "Mail Templates" link:

templates_account_home.PNG

Mail Templates settings page will appear:

templates_settings_home.PNG

Click "Hosting Space Summary Letter" link:

templates_space_summary.PNG

Update "From", "CC", "Subject", both HTML and Text templates and click "Save" button to save changes.

Space Summary Template Variables

The following variables and constructs are supported in "Subject", "HTML Body" and "Text Body" templates:

#Signup# - is equal to "true" if the letter is sent during user account creation; otherwise when user re-sends the letter it is "false".

Can be used in the template as following:

 

<ad:if test="#Signup#">
This content will be included in the summary during signup only.
</ad:if>

#user# - hosting space owner is a complex structure described in the section above.

In templates it can be used as following:

Hello, #user.FullName#
Your registered e-mail address is: #user.Email#

#reseller# -  host account. It is a complex structure with the same fields as "user" one.

#space# - space context is a complex structure with fields described in the section above.

#plan# - space hosting plan is a complex structure with fields described in the section above.

#PackageRootFolder# - the physical location of hosting space home folder, for example:

 

Your space is located here: #PackageRootFolder#

#NameServers# - string array of name servers assigned to hosting space, for example:

 

Your name servers:
<ad:foreach collection="#NameServers#" var="NameServer">
   #NameServer#
</ad:foreach>

#InstantAlias# - instant alias (temporary URL) assigned to hosting space, for example:

 

<ad:if test="#isnotempty(InstantAlias)#">
You can use the following Temporary URL for all your web sites:
http://YourDomain.com.#InstantAlias#
</ad:if>

#WebSites# - collection of web sites created in this hosting space. Each item in the collection is a complex structure with the following fields:

  • SiteId (string) - web site ID (e.g. W3SVC/1)
  • Name (string) - web site description (e.g. mysite.com)
  • SiteIPAddress - web site IP address (e.g. 23.32.20.1) 

#Domains# - collection of domains created in this hosting space. Each item in the collection is a complex structure with the following fields:

  • DomainName (string) - the name of the domain
  • WebSiteName (string) - the name of web site this domain points to
  • MailDomainName (string) - the name of mail domain this domain points to
  • ZoneName (string) - the name of DNS zone this domains points to
  • IsSubDomain (bool)
  • IsInstantAlias (bool)

#FtpIP# - IP address of FTP server

#FtpAccounts# - collection of FTP accounts created in this hosting space. Each item in the collection is a complex structure with the following fields:

  • Name (string) - account name
  • Folder (string) - root folder of this account
  • Password (string)

#MailAccounts# - collection of mail accounts created in this hosting space. Each item in the collection is a complex structure with the following fields:

  • Name (string) - account name
  • Password (string)

#MailIP# - IP address of mail server

#MsSQL2000Address# - "External Address" of MS SQL 2000 service

#MsSQL2005Address# - "External Address" of MS SQL 2005 service

#MsSQL2008Address# - "External Address" of MS SQL 2008 service

#MySQL4Address# - "External Address" of MySQL 4 service

#MySQL5Address# - "External Address" of MySQL 5 service

Password Reminder Template

To change this template login under "serveradmin" or other account with reseller privileges.

On right panel of user account home page click "Mail Templates" link:

templates_account_home.PNG

Mail Templates settings page will appear:

templates_settings_home.PNG

Click "Password Reminder Letter" link:

templates_password_reminder.PNG

Update "From", "CC", "Subject", both HTML and Text templates and click "Save" button to save changes.

Password Reminder Template Variables

The following variables and constructs are supported in "Subject", "HTML Body" and "Text Body" templates:

#user# - user account is a complex structure described in the section above.

#reseller# -  host (reseller) account. It is a complex structure with the same fields as "user" one.

Add Feedback