> For the complete documentation index, see [llms.txt](https://docs.toomuchmedia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toomuchmedia.com/nats-admin/sites/site-templates/mailer-template-variables.md).

# Mailer Template Variables

*Article Topics:* [*Sites*](/getting-started/common-topics/sites.md)*,* [*Communications*](/getting-started/common-topics/communications.md)*,* [*Customization*](/getting-started/common-topics/customization.md)*,* [*Smarty*](/getting-started/common-topics/smarty.md)

{% hint style="warning" %}
**Very Important:** Mailer Template Variables, which are used in the [Site Admin](/nats-admin/sites.md), are not to be confused with Mass Mailer Template Variables, which are used in the [Mass Mailer Admin](/nats-admin/mass-mailing.md).

To learn more about Mass Mailer Template Variables used in Mass Mailer Templates, see "[Mass Mailer Template Variables.](/nats-admin/mass-mailing/further-reading/mass-mailer-template-variables.md)"
{% endhint %}

You can use the following variables, grouped by their arrays, on templates in [Site Templates ](/nats-admin/sites/site-templates.md)that get mailed to affiliates and members.&#x20;

For example, *mail\_affiliate\_on\_member\_joined* or *mail\_member\_change*. When testing your changes, make sure that you customize both the regular e-mail template and the \_html e-mail template. Unless both forms of the template are properly configured, your e-mails will not be sent.

## member

The following variables hold members' information. These are available in *mail\_member\_*, *mail\_owner\_*, and *mail affiliate\_on\_member\_*:

* {$member.loginid} - The affiliate's ID that member was referred from in NATS
* {$member.status} - the status of the member.
  * 0: Never Joined
  * 1: Active
  * 2: Expired
* {$member.trial} - whether they are on trial or not.
  * 0: not trial
  * 1: trial
* {$member.joined} - when they joined
* {$member.expired} - when they have completely expired (set to 0 until completely expired)
* {$member.siteid} - site id member signed up under
* {$member.optionid} - join option id member signed up under
* {$member.billerid} - biller id member signed up under
* {$member.rebills} - the time the member will rebill next
* {$member.custom1} - the custom field in the members admin
* {$member.custom2}
* {$member.custom3}
* {$member.custom4}
* {$member.custom5}
* {$member.transaction} - Array of transaction details
* {$member.transaction.transaction\_id} - transaction ID under the subscription in NATS
* {$member.transaction.biller\_transid} - Biller transaction ID reported to NATS with biller short name prepended
* {$member.transaction.biller\_time} - time the transaction occured on biller's side
* {$member.transaction.server\_time} - time the transaction was recorded in NATS
* {$member.transaction.biller\_transid} - transaction ID on the biller's side
* {$member.transaction.total\_transaction\_payout} - payout to the affiliate on this transaction
* {$member.transaction.amount} - calculated amount of transaction in NATS
* {$member.transaction.biller\_amount} - amount of transaction reported by biller
* {$member.transaction.biller\_currency} - currency of biller\_amount reported by biller

\
The following variables hold additional members' information but are only available in *mail\_member\_* and *mail\_owner\_*:

* {$member.memberid} - the id of the member
* {$member.firstname} - first name of the member
* {$member.lastname} - last name of the member
* {$member.address1} - first line of address
* {$member.address2} - second line of address
* {$member.zip} - the zip code
* {$member.city} - city of address
* {$member.country} - country
* {$member.state} - state
* {$member.member\_subscription\_id} - subscription ID of member in NATS
* {$member.shipping\_firstname} - shipping first name
* {$member.shipping\_lastname} - shipping last name
* {$member.shipping\_address1} - shipping address 1
* {$member.shipping\_address2} - shipping address 2
* {$member.shipping\_zip} - shipping zip code
* {$member.shipping\_city} - shipping city
* {$member.shipping\_country} - shipping country
* {$member.shipping\_state} - shipping state
* {$member.phone} - member's phone number
* {$member.xsell\_success} - Do Not Use
* {$member.xsell\_message} - the xsell message sent
* {$member.last\_modified} - last time the member was modified
* {$member.identid} - a unique number that contains information about the campaignid, tourid, siteid, optionid etc.
* {$member.refurl\_lookup\_id} An id that identifies the URL that referred the member.
  * Note: This only retrieves the ID number and not the referring URL. To get the URL, use the template function *nats\_get\_refurl*.
  * For example: `{nats_get_refurl refid=$member.refurl_lookup_id}` to set the function, then use the Smarty function: `{$nats_refurl}` to display it.
* {$member.last\_login} - last time they logged in
* {$member.stamp} - last time member was updated
* {$member.username} - the member's username
* {$member.cryptpass} - the crypted password
* {$member.ip} - the ip they used to sign up
* {$member.email} - the email they signed up with
* {$member.session} - session id of the member in NATS
* {$member.mailok} - if the member opted in for emails. 1 if yes, 0 for no
* {$member.flat\_price}
* {$member.first\_login} - when they first logged in.
* {$member.third\_party\_partner\_id} - the id of the third party
* {$member.cascadeid} - The id for the cascade that the member used to sign up.
* {$member.cascade\_item\_id} - The id for the biller in the cascade that the member used to sign up.
* {$member.token} - The hash that each member of a token site uses to authenticate.
* {$member.original\_username} The member's original username.
* {$member.renamed} - The date when the member's username was changed.

## affiliate

The following variables hold affiliates' information, for affiliates that sign up to your affiliate program. These variables can be used on the mailer templates *mail\_owner\_affiliate\_signup* and *mail\_affiliate\_on\_signup*. All of the stored affiliate information can be found in the $affiliate array.

* {$affiliate.nats}
* {$affiliate.company}
* {$affiliate.url}
* {$affiliate.firstname}
* {$affiliate.lastname}
* {$affiliate.email}
* {$affiliate.nostore\_verify\_email}
* {$affiliate.mailok}
* {$affiliate.username}
* {$affiliate.password}
* {$affiliate.nostore\_verify\_password}
* {$affiliate.address1}
* {$affiliate.address2}
* {$affiliate.city}
* {$affiliate.state}
* {$affiliate.zip\_code}
* {$affiliate.country}
* {$affiliate.tax\_id\_or\_ssn}
* {$affiliate.payvia}
* {$affiliate.minimum\_payout}
* {$affiliate.verify}

## details.loginid

The details.login array holds the NATS information about an affiliate who referred a specific member. These variables can be used on the mailer templates beginning with the *mail\_member\_*, *mail\_owner\_*, and *mail\_affiliate\_* prefixes.

* {$details.loginid.loginid} - affiliate's ID in NATS
* {$details.loginid.username} - affiliate's username
* {$details.loginid.password} - affiliate's password
* {$details.loginid.deleted} - if the affiliate is deleted or not.
  * 0 - not deleted
  * 1 - deleted
* {$details.loginid.type} - ID access level of the affiliate
* {$details.loginid.skinid} - ID of the skin the affiliate is using
* {$details.loginid.payvia\_type\_id} - ID of the payvia method affiliate is using
* {$details.loginid.status} - status of the affiliate
  * 0: Active
  * 1: Disabled
  * 2: Banned
  * 3: Wait on Verify
  * 4: Pending
  * 5: Denied
* {$details.loginid.pass\_hash} - password hash
* {$details.loginid.join\_date} - when the affiliate joined
* {$details.loginid.inhouse} - if the affiliate is an inhouse account or not
  * 0 - not inhouse
  * 1 - inhouse
* {$details.loginid.firstname} - affiliate's first name
* {$details.loginid.lastname} - affiliate's last name
* {$details.loginid.email} - affiliate's email
* {$details.loginid.date\_posted}
* {$details.loginid.last\_login} - when the affiliate last logged in
* {$details.loginid.last\_login\_ip} - the IP the affiliate last logged in from
* {$details.loginid.reviewed} - if the affiliate is manually marked as reviewed
  * 0 - not reviewed
  * 1 - reviewed
* {$details.loginid.minimum\_payout} - the minimum payout the affiliate set for their payvia type
* {$details.loginid.bonus}
* {$details.loginid.verify}
* {$details.loginid.reason}
* {$details.loginid.unencoded}
* {$details.loginid.startpage}
* {$details.loginid.rep\_baseline}
* {$details.loginid.company} - the company of the affiliate
* {$details.loginid.url} - the url of the affiliate
* {$details.loginid.tel} - the telephone number of the affiliate
* {$details.loginid.address1} - address of affiliate
* {$details.loginid.address2}
* {$details.loginid.city} - city of affiliate
* {$details.loginid.state} - state of affiliate
* {$details.loginid.country} - country of affiliate
* {$details.loginid.zip\_code} - zip code of affiliate
* {$details.loginid.tax\_id\_or\_ssn} - tax ID or SSN of the affiliate
* {$details.loginid.invoicer}
* {$details.loginid.req\_docs} - if affiliate is marked as having the required documentation
* {$details.loginid.w9} - if the affiliate has a W9 uploaded or not
  * 0 - no W9
  * 1 - has W9
* {$details.loginid.mailok} - if affiliate opted in for emails or not
  * 0 - not opted in
  * 1 - opted in
* {$details.loginid.trust\_level}
* {$details.loginid.new\_notification}
* {$details.loginid.default\_campaign}
* {$details.loginid.default\_program}
* {$details.loginid.default\_site}
* {$details.loginid.pv\_instant}
* {$details.loginid.payout\_approval}

## biller

The details.billerid array holds information about the biller the member signed up under. These variables can be used on the mailer templates beginning with the *mail\_member\_*, *mail\_owner\_*, and *mail\_affiliate\_on\_member\_* prefixes.

* {$details.billerid.billerid} - ID of the biller in NATS
* {$details.billerid.networkid}
* {$details.billerid.biller} - the name of the biller
* {$details.billerid.last\_poll}
* {$details.billerid.form\_method}
* {$details.billerid.deleted}

## details.campaignid

The details.campaignid array holds information about the campaign that the member signed up under. These variables can be used on the mailer templates beginning with the *mail\_member\_*, *mail\_owner\_*, and *mail\_affiliate\_on\_member\_* prefixes.

* {$details.campaignid.campaignid}
* {$details.campaignid.loginid}
* {$details.campaignid.name}
* {$details.campaignid.description}
* {$details.campaignid.created\_date}
* {$details.campaignid.hide}
* {$details.campaignid.old\_campaignid}

## details.programid

The details.programid array holds information about the program that the member signed up under. These variables can be used on the mailer templates beginning with the *mail\_member\_*, *mail\_owner\_*, and *mail\_affiliate\_on\_member\_* prefixes.

* {$details.programid.programid}
* {$details.programid.program}
* {$details.programid.hidden}
* {$details.programid.type}
* {$details.programid.name}
* {$details.programid.extended\_payout}
* {$details.programid.max\_ratio}
* {$details.programid.fallbackid}
* {$details.programid.addstr}
* {$details.programid.deleted}
* {$details.programid.abi\_paycom\_prefix}
* {$details.programid.abi\_paycom\_perc}
* {$details.programid.deduct\_credits}
* {$details.programid.deduct\_chargebacks}
* {$details.programid.deduct\_voids}
* {$details.programid.deduct\_insufficient}
* {$details.programid.verify\_hash}
* {$details.programid.verify\_initial}
* {$details.programid.retro\_payout}
* {$details.programid.hide\_rebills}
* {$details.programid.hide\_joins}
* {$details.programid.description}
* {$details.programid.thumb}

## details.siteid

The details.siteid array holds information about the site the member signed up under. These variables can be used on the mailer templates beginning with the *mail\_member\_*, *mail\_owner\_*, and *mail\_affiliate\_on\_member\_* prefixes.

* {$details.siteid.siteid}
* {$details.siteid.networkid}
* {$details.siteid.site}
* {$details.siteid.deleted}
* {$details.siteid.name}
* {$details.siteid.type}
* {$details.siteid.hidden}
* {$details.siteid.date\_added}
* {$details.siteid.date\_live}
* {$details.siteid.network}
* {$details.siteid.reuse\_active}
* {$details.siteid.no\_personal\_member\_info}
* {$details.siteid.mobile\_tour}
* {$details.siteid.site\_group\_id}

## details.tourid

The details.tourid array holds information about the tour the member signed up under. These variables can be used on the mailer templates beginning with the *mail\_member\_*, *mail\_owner\_*, and *mail\_affiliate\_on\_member\_* prefixes.

* {$details.tourid.tourid}
* {$details.tourid.tour}
* {$details.tourid.siteid}
* {$details.tourid.networkid}
* {$details.tourid.name}
* {$details.tourid.url}
* {$details.tourid.linkdomain}
* {$details.tourid.description}
* {$details.tourid.thumb}
* {$details.tourid.thumb\_ext}
* {$details.tourid.third\_party\_partner\_id}
* {$details.tourid.spartaurl}
* {$details.tourid.denyurl}
* {$details.tourid.denypost}
* {$details.tourid.approvalurl}
* {$details.tourid.approvalpost}
* {$details.tourid.rebillpost}
* {$details.tourid.creditpost}
* {$details.tourid.chargebackpost}
* {$details.tourid.insufficient\_fundpost}
* {$details.tourid.voidpost}
* {$details.tourid.userpost}
* {$details.tourid.userman}
* {$details.tourid.expirepost}
* {$details.tourid.custom}
* {$details.tourid.admin\_signup\_email}
* {$details.tourid.upgradeurl}
* {$details.tourid.upgradepost}
* {$details.tourid.allowed\_lang}
* {$details.tourid.alternativeurl}
* {$details.tourid.allowed\_lang\_track\_raw}
* {$details.tourid.allowed\_lang\_track\_unq}
* {$details.tourid.hidden}
* {$details.tourid.mail\_member\_joined}
* {$details.tourid.mail\_member\_cancelled}
* {$details.tourid.mail\_member\_rebilled}
* {$details.tourid.mail\_member\_credited}
* {$details.tourid.mail\_member\_chargedback}
* {$details.tourid.mail\_member\_insufficient}
* {$details.tourid.mail\_member\_voided}
* {$details.tourid.upgradedenyurl}
* {$details.tourid.upgradedenypost}
* {$details.tourid.prejoinpost}
* {$details.tourid.byo\_owner}
* {$details.tourid.byo\_program}
* {$details.tourid.byo\_owner\_only}
* {$details.tourid.deleted}
* {$details.tourid.niche}
* {$details.tourid.strack\_programid}
* {$details.tourid.mail\_member\_change}
* {$details.tourid.change\_detailspost}

## details.optionid

The details.optionid array holds information about the join option the member signed up under. These variables can be used on the mailer templates beginning with the *mail\_member\_*, *mail\_owner\_*, and *mail\_affiliate\_on\_member\_* prefixes.

* {$details.optionid.optionid}
* {$details.optionid.initial}
* {$details.optionid.initial\_days}
* {$details.optionid.rebill}
* {$details.optionid.rebill\_days}
* {$details.optionid.name}
* {$details.optionid.packageid}
* {$details.optionid.no\_old\_members}
* {$details.optionid.hidden}
* {$details.optionid.initial\_free}
* {$details.optionid.package\_upgrade\_allowed}
* {$details.optionid.token\_rebuy\_allowed}

## details.countryid

If country information is available, you can also use the following variables in details.countryid array. These variables can be used on the mailer templates beginning with the *mail\_member\_*, *mail\_owner\_*, and *mail\_affiliate\_on\_member\_* prefixes.

* {$details.countryid.short} - two letter abbreviation of country
* {$details.countryid.name} - full name of country

## Profits

### True Profit Calculations

Profit calculation(in mail\_owner\_joined template):\
{math equation="(y-x-z)/100" x=$member.cost\_charge y=$member.transaction.amount z=$member.transaction.total\_transaction\_payout assign='profit'}\
Profit: {$profit|string\_format:"%.2f"}

In this equation, the variable Z calculates the affiliate [payouts ](/nats-admin/payments/payout-periods.md)for ALL affiliates including site partners etc.
