Difference between revisions of "Email variables"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 94: Line 94:
<br>
<br>
<br>
<br>
===Payment===
* '''<%= payment_id %>''' - Payment ID
* '''<%= payment_tax''' - Payment Tax
* '''<%= payment_gross %>''' - Payment Gross
* '''<%= payment_user %>''' - Payment User


=== Example ===
=== Example ===

Revision as of 12:01, 11 October 2018

These variables can be used in emails (both in Email Subject line and in Email Body):

Every email

  • <%= server_ip %> - server IP where your users should register their SIP/IAX2 devices.
  • <%= device_type %> - shows the user's primary device type. (The device is set as the primary device after user registration).
  • <%= device_username %> - shows the user's primary device username. (The device is set as the primary device after user registration).
  • <%= device_password %> - shows the user's primary device password. (The device is set as the primary device after user registration).
  • <%= login_url %> - GUI login url.
  • <%= login_username %> - user's username to login to GUI.
  • <%= username %> - same as login_username.
  • <%= first_name %> - first name of the user.
  • <%= last_name %> - last name of the user.
  • <%= full_name %> - first name and last name of the user.
  • <%= balance %> - user's balance.
  • <%= credit %> - user's credit.
  • <%= nice_balance %> - formated user's balance.
  • <%= warning_email_balance %> - amount below which user should be warned with email.
  • <%= nice_warning_email_balance %> - formated amount below which user should be warned with email.
  • <%= currency %> - default system currency's short name (USD).
  • <%= user_email %> - user's email address.
  • <%= company_email %> - company email address.
  • <%= email %> - company email address.
  • <%= company %> - company title.
  • <%= primary_device_pin %> - PIN of user's default device. The fault device is created the moment the user registers, so this variable can be used universally.
  • <%= calldate %> - used only from api request email_send.
  • <%= source %> - used only from api request email_send.
  • <%= destination %> - used only from api request email_send.
  • <%= billsec %> - used only from api request email_send.
  • <%= balance_range_min %> - Balance range min. value set in User settings. M2 only.
  • <%= balance_range_max %> - Balance range max. value set in User settings. M2 only.
  • <%= warning_balance_admin_value %> - Warning balance Admin value set in User settings. M2 only.

After registration

These variables are only available to email templates which are used to send emails after user's successful registration.

  • <%= login_password %> - user's password to login to GUI.
  • <%= user_ip %> - user's IP address.

Invoices

These variables are only available to invoices template which is used to send Invoices

  • <%= invoice_price %> - price of Invoice.
  • <%= invoice_price_with_tax %> - price of Invoice with Tax.
  • <%= invoice_currency %> - Invoice currency.
  • <%= invoice_period_start %> - Invoice period start.
  • <%= invoice_period_end %> - Invoice period end.

Cyberplat payment report

  • <%= currency %> - payment currency.
  • <%= amount %> - payment amount.
  • <%= date %> - payment date.
  • <%= auth_code %> - authorization code.
  • <%= transaction_id %> - payment transaction ID provided by Cyberplat.
  • <%= customer_name %> - payment customer name provided by Cyberplat.
  • <%= description %> - payment details provided by Cyberplat.

Calling Card purchase

  • <%= cc_purchase_details %> - cards list (Number, Pin, Price).

Recordings

Templates recording_new and recording_delete accept only these variables:

  • <%= calldate %> - Call date and time (when Call started).
  • <%= source %> - Source number (number only, CallerID name included).
  • <%= destination %> - Destination number.
  • <%= billsec %> - Call duration.
  • <%= full_name %> - first name and last name of the user.

CDR Export

Templates cdr_export_success and cdr_export_error accept only these variables:

  • <%= current_date %> - current date (when CDR Export was executed).
  • <%= date_from %> - Date 'From', specified in Last Calls filter.
  • <%= date_till %> - Date 'Till', specified in Last Calls filter.
  • <%= archive_size %> - size of CDR archive (tgz).
  • <%= search_user_username %> - username to login of the user who was selected in search filter.
  • <%= search_user_fullname %> - first name and last name of the user who was selected in search filter.
  • <%= search_reseller_username %> - username to login of the reseller who was selected in search filter.
  • <%= search_reseller_fullname %> - first name and last name of the reseller who was selected in search filter.
  • <%= search_device_description %> - description of the device which was selected in search filter.
  • <%= search_device_username %> - username of the device which was selected in search filter.

Provider Deviation Observers

  • <%= lcr_name %> - Observed LCR name.
  • <%= lcr_id %> - Observed LCR id.
  • <%= provider_name %> - Main Provider.
  • <%= asr_deviation %> - tolerated ASR deviation.
  • <%= acd_deviation %> - tolerated ACD deviation.
  • <%= changed_providers %> - comma separated list of changed Privders in a Deviation Observer.



Payment

  • <%= payment_id %> - Payment ID
  • <%= payment_tax - Payment Tax
  • <%= payment_gross %> - Payment Gross
  • <%= payment_user %> - Payment User

Example

This template:

 Hello, <%=full_name%>
 <br><br>
 Your balance in MOR has fallen below <%= nice_warning_email_balance %> <%= currency %> and now is <%= nice_balance %> <%= currency %>.
 <br>
 Please login to <%= login_url %> and replenish it.
 <br><br>
 Yours sincerely,
 <br>
 KOLMISOFT

will result in an email similar to this:

 Hello, John Smith

 Your balance in MOR has fallen below 10.00 USD and now is 5.67 USD.
 Please login to http://your_site/billing and replenish it.

 Yours sincerely,
 KOLMISOFT



Illegal usage

You will get an error when you try to use non-existent variables.

Also, you cannot use something like this: <%= "www.kolmisoft.com" %>



See also