Difference between revisions of "Email variables"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(44 intermediate revisions by 10 users not shown)
Line 1: Line 1:
These variables can be used in emails:
These variables can be used in emails (both in Email Subject line and in Email Body):


* '''<%= server_ip %>''' - Server IP where your users should register their SIP/IAX2 devices
===Every email===
* '''<%= device_type %>''' - Shows users primary device's type. (Device after user registration is set as primary device)
* '''<%= server_ip %>''' - server IP where your users should register their SIP/IAX2 devices.
* '''<%= device_username %>''' - Shows users primary device's username. (Device created after user registration is set as primary device)
* '''<%= device_type %>''' - shows the user's primary device type. (The device is set as the primary device after user registration).
* '''<%= device_password %>''' - Shows users primary device's password. (Device created after user registration is set as primary device)
* '''<%= device_username %>''' - shows the user's primary device username. (The device is set as the primary device after user registration).
* '''<%= login_url %>''' - GUI login url
* '''<%= device_password %>''' - shows the user's primary device password. (The device is set as the primary device after user registration).
* '''<%= login_username %>''' - User's username to login to GUI
* '''<%= login_url %>''' - GUI login url.
* '''<%= username %>''' - same as login_username
* '''<%= login_username %>''' - user's username to login to GUI.
* '''<%= first_name %>''' - First name of the user
* '''<%= username %>''' - same as login_username.
* '''<%= last_name %>''' - Last name of the user
* '''<%= first_name %>''' - first name of the user.
* '''<%= full_name %>''' - First name and last name of the user
* '''<%= last_name %>''' - last name of the user.
* '''<%= balance %>''' - User's balance
* '''<%= full_name %>''' - first name and last name of the user.
* '''<%= nice_balance %>''' - Formated user's balance
* '''<%= balance %>''' - user's balance.
* '''<%= warning_email_balance %>''' - Amount below which user should be warned with email.
* '''<%= credit %>''' - user's credit. <!---from x11--->
* '''<%= nice_warning_email_balance %>''' - Formated amount below which user should be warned with email.
* '''<%= nice_balance %>''' - formated user's balance.
* '''<%= currency %>''' - Default system currencies short name (USD).
* '''<%= warning_email_balance %>''' - amount below which user should be warned with email.
* '''<%= user_email %>''' - Users email address
* '''<%= nice_warning_email_balance %>''' - formated amount below which user should be warned with email.
* '''<%= company_email %>''' - Company email address
* '''<%= currency %>''' - default system currency's short name (USD).
* '''<%= email %>''' - Company email address
* '''<%= user_email %>''' - user's email address.
* '''<%= company %>''' - Company title
* '''<%= 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 [[MOR API email_send| email_send]].
* '''<%= source %>''' - used only from api request [[MOR API email_send| email_send]].
* '''<%= destination %>''' - used only from api request [[MOR API email_send| email_send]].
* '''<%= billsec %>''' - used only from api request [[MOR API email_send| 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===
===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
* '''<%= login_password %>''' - user's password to login to GUI.
* '''<%= user_ip %>''' - User's IP address
* '''<%= user_ip %>''' - user's IP address.


===Cyberplay payment report===
===Invoices===
''These variables are only available to [[Emails|invoices template]] which is used to [[Invoices#Send_invoices_by_email_.28manual.29|send Invoices]]''


* '''<%= currency %>''' - Payment currency
* '''<%= invoice_price %>''' - price of Invoice.
* '''<%= amount %>''' - Payment amount
* '''<%= invoice_price_with_tax %>''' - price of Invoice with Tax.
* '''<%= date %>''' - Payment date
* '''<%= invoice_currency %>''' - Invoice currency.
* '''<%= auth_code %>''' - Authorization code  
* '''<%= invoice_period_start %>''' - Invoice period start.
* '''<%= transaction_id %>''' - Payment transaction ID provided by Cyberplat
* '''<%= invoice_period_end %>''' - Invoice period end.
* '''<%= customer_name %>''' - Payment customer name provided by Cyberplat
 
* '''<%= description %>''' - Payment details provided by Cyberplat
===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:<br>
 
* '''<%= 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:<br>
 
* '''<%= 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
* '''<%= payment_user_balance_before %>''' - User's balance before making payment
* '''<%= payment_user_balance_after %>''' - User's balance after making payment
 
===Statement of Account===
* '''<%= full_name %>''' - User Full Name
* '''<%= date %>''' - Email sending date
 
===Auto Aggregate Report===
* '''<%=  auto_aggregate_export_from %>''' - Export from date
* '''<%=  auto_aggregate_export_till %>''' - Export till date
* '''<%=  auto_aggregate_export_template %>''' - Export template
 
===Automatic tariff import===
Please see [[Automatic_Tariff_Import#Notifications|here]].
 
===Two Factors authentication===
* '''<%= two_fa_code %>''' - two factors authentication code
* '''<%= user_edit_url %>''' - URL to users settings page
* '''<%= current_time %>''' - current date and time
* '''<%= two_fa_code_attempt %>''' - number of attempt
* '''<%= two_fa_login_status %>''' - login status
* '''<%= two_fa_login_ip %>''' - IP which tries to login
 
===Fax2email===
* '''<%= first_name %>''' - first name of the user.
* '''<%= last_name %>''' - last name of the user.
* '''<%= full_name %>''' - first name and last name of the user.
* '''<%= source %>'''
 
<br>
<br>


=== Example ===
=== Example ===
Line 40: Line 134:
<pre>
<pre>
  Hello, <%=full_name%>
  Hello, <%=full_name%>
 
<br><br>
  Your balance in MOR has run out bellow <%= nice_warning_email_balance %> <%= currency %> and now is <%= nice_balance %> <%= currency %>.
  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.
  Please login to <%= login_url %> and replenish it.
 
<br><br>
  Yours Sincerely,
  Yours sincerely,
<br>
  KOLMISOFT
  KOLMISOFT
</pre>
</pre>
Will result in email similar to this:  
 
will result in an email similar to this:  


<pre>
<pre>
  Hello, John Smith
  Hello, John Smith


  Your balance in MOR has run out bellow 10.00 USD and now is 5.67 USD.
  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.
  Please login to http://your_site/billing and replenish it.


  Yours Sincerely,
  Yours sincerely,
  KOLMISOFT
  KOLMISOFT
</pre>
</pre>
   
   
<br><br>
= 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" %>
<br><br>
<br><br>
= See also =
= See also =
* [[Configuration from GUI#Emails | Email Configuration]]
* [[Configuration from GUI#Emails | Email Configuration]]
* [[Emails|Mass Emails]]

Latest revision as of 06:30, 13 January 2023

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
  • <%= payment_user_balance_before %> - User's balance before making payment
  • <%= payment_user_balance_after %> - User's balance after making payment

Statement of Account

  • <%= full_name %> - User Full Name
  • <%= date %> - Email sending date

Auto Aggregate Report

  • <%= auto_aggregate_export_from %> - Export from date
  • <%= auto_aggregate_export_till %> - Export till date
  • <%= auto_aggregate_export_template %> - Export template

Automatic tariff import

Please see here.

Two Factors authentication

  • <%= two_fa_code %> - two factors authentication code
  • <%= user_edit_url %> - URL to users settings page
  • <%= current_time %> - current date and time
  • <%= two_fa_code_attempt %> - number of attempt
  • <%= two_fa_login_status %> - login status
  • <%= two_fa_login_ip %> - IP which tries to login

Fax2email

  • <%= first_name %> - first name of the user.
  • <%= last_name %> - last name of the user.
  • <%= full_name %> - first name and last name of the user.
  • <%= source %>



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