Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Because the {invoices} tag is an array of objects (i.e. possibly multiple invoices), it should not be used as written. Instead, you should configure the template to loop through each invoice individually by using the for notation described under Customizing Emails.

...

TagDescriptionNotes
{contact.first_name}The client's first name 
{contact.last_name}The client's last name 
{contact.email}The client's email address 
{contact.id_code}The client's IDe.g. 1500
{autodebit}Whether or not autodebit is enabled for this clienti.e. 1 or 0, denoting yes or no, respectively
{client_url}The URI to Blesta's client interfacee.g. domain.com/billing/client/

This email template includes invoice payment links that you can make available in the email to allow customers to pay an invoice without having to login to their client account. Each invoice available in the {invoices} tag includes a payment_url. You can iterate over each invoice in the template to set the link. Consider the following example:

Code Block
languagenone
{% for invoice in invoices %}
Invoice ID: {invoice.id_code}
Amount Due: {invoice.due}
Pay now at https://{invoice.payment_url}.
{% endfor %}
Expand
titleAdditional Tags

Due to the nature of tag objects containing several fields, many of which are likely irrelevant for use in email templates, but may be useful to you in certain circumstances, an example dump of the tag objects are shown below.

Code Block
languagephp
titleThe {contact} object
collapsetrue
stdClass Object
(
    [id] => 1
    [client_id] => 1
    [user_id] => 
    [contact_type] => primary
    [contact_type_id] => 
    [first_name] => First
    [last_name] => Last
    [title] => 
    [company] => Company Co.
    [email] => first.last@domain.com
    [address1] => 123 Main St.
    [address2] => 
    [city] => City
    [state] => CA
    [zip] => 90001
    [country] => stdClass Object
        (
            [alpha2] => US
            [alpha3] => USA
            [name] => United States
            [alt_name] => 
        )
    [date_added] => 2014-05-08 21:35:13
    [contact_type_name] => 
    [contact_type_is_lang] => 
)
Expand
titleAdditional Tags
Due to the nature of tag objects containing several fields, many of which are likely irrelevant for use in email templates, but may be useful to you in certain circumstances, an example dump of the tag objects are shown below.
Code Block
languagephp
titleThe {contactinvoices} objectarray of objects
collapsetrue
stdClassArray Object
(
    [id0] => 1 stdClass Object
        (
            [id_format] => {num}505
            [id_valueformat] => 1500
 {num}
      [user_id] => 2
    [clientid_group_idvalue] => 1171
    [primary_account_id] => 
        [primaryclient_account_typeid] => 1
    [status] => active
        [iddate_codebilled] => 1500
    [contact_id] => 1
2014-09-18 07:00:00
      [first_name] => First
    [lastdate_namedue] => Last2014-09-23 07:00:00
    [company]  => Company Co.
    [emaildate_closed] => first.last@domain.com
    [address1] => 123 Main St.
    [address2date_autodebit] => 
     [city]  => City
    [statestatus] => CAactive
      [zip] => 90001
    [countrysubtotal] => US1.0000
      [group_name] => General
    [company_idtotal] => 1.0000
            [usernamepaid] => first0.last@domain.com0000
     [two_factor_mode] => none
       [twoprevious_factor_keydue] => 829.5010
      [two_factor_pin] => 
    [date_addedcurrency] => 2014-06-25 18:05:34
)
Code Block
languagephp
titleThe {invoices} array of objects
collapsetrue
Array ( USD
    [0        [note_public] => 
  stdClass  Object
        ([note_private] => 
            [id_code] => 1171
            [iddelivery_date_formatsent] => {num}
            [id_valuedue] => 1.0000
            [clientline_iditems] => 1
 Array
                (
     [date_billed] => 2014-06-25 00:00:00
            [date_due0] => 2014-07-01 00:00:00stdClass Object
            [date_closed] => 
            [date_autodebit] => 2014-06-29 00:00:00(
            [status] => active
                [subtotalid] => 10.00001181
              [total] => 10.0000
            [paidinvoice_id] => 10.0000505
            [previous_due] => 0.0000
                [currencyservice_id] => USD
              [note_public] => 
            [note_privatedescription] => Line Item Description
            [id_code] => 1000
                [delivery_date_sentqty] => 2014-06-25 23:15:00
1.0000
              [due] => 0.0000
            [line_itemsamount] => Array1.0000
                 (
           [subtotal] => 1.00000000
       [0] => stdClass Object
                  [taxes] => Array
    (
                            [id] => 1
(
                              [invoice_id] => 1)
                            [servicetaxes_idapplied] => 1Array
                             [description] => Bronze Standard(
 - domain.com
                            [qty] => 1.0000)
                            [amounttax_subtotal] => 10.00000
                            [subtotaltax_total] => 10.000000000
                            [taxestotal] => Array1
                            [total_w_tax] =>   (1
                                )
 
               )
             [taxes_applieddelivery] => Array
                (
                 (
    [0] => stdClass Object
                         )(
 
                            [tax_subtotalid] => 0510
                             [taxinvoice_totalid] => 0505
                             [totalmethod] => 10email
                             [totaldate_w_taxsent] => 10
                         )
                )
 
            [deliverymeta] => Array
                (
                )
    [0] => stdClass Object
     [tax_subtotal] => 0
            [tax_total]     (=> 0
            [taxes] => Array
              [id] => 1(
                )
            [invoice_idbilling] => stdClass 1Object
                (
            [method] => email
      [id] => 1
                    [dateclient_sentid] => 1
                    [user_id] =>   )
                )
 
            [meta[contact_type] => Array
   primary
             (
       [contact_type_id] => 
       )
 
            [taxfirst_subtotalname] => 0First
            [tax_total] => 0
            [taxes[last_name] => ArrayLast
                (
    [title] =>   
        )
        )
    [1company] => stdClassCompany ObjectCo.
        (
            [idemail] => 2first.last@domain.com
            [id_format] => {num}
            [id_valueaddress1] => 2 123 Main St.
            [client_id] => 1
      [address2] => 
    [date_billed] => 2014-06-26 00:00:00
              [date_duecity] => 2014-07-01 00:00:00
City
                    [date_closedstate] => CA
             [date_autodebit] => 2014-06-29 00:00:00
    [zip] => 90001
      [status] => active
            [subtotalcountry] => stdClass 20.0000Object
            [total] => 20.0000
          (
  [paid] => 20.0000
            [previous_due] => 0.0000
            [currencyalpha2] => USDUS
            [note_public] => 
                [note_privatealpha3] => USA
              [id_code] => 1001
            [delivery_date_sentname] => 2014-06-26 23:15:00United States
            [due] => 0.0000
                [linealt_itemsname] => Array
                (
        )
            [0] => stdClass Object
     [date_added] =>   2014-05-08 21:35:13
               (
     [contact_type_name] =>  
                    [idcontact_type_is_lang] => 1
                )
            [invoice_idclient] => stdClass 2Object
               (
             [service_      [id] => 1
                            [description[id_format] => Gold{num}
 Standard - domain2.com
                [id_value] => 1500
          [qty] => 1.0000
       [user_id] => 2
                   [amountclient_group_id] => 20.00001
                   [primary_account_id] => 
         [subtotal]  => 20.00000000
       [primary_account_type] => 
                   [taxesstatus] => Arrayactive
                   [id_code] => 1500
           (
        [contact_id] => 1
                   [first_name] =>  )First
 
                            [taxes_applied[last_name] => ArrayLast
                                (
[company] => Company Co.
                   [email] => first.last@domain.com
             )
 
     [address1] => 123 Main St.
                   [tax_subtotaladdress2] => 0
                            [tax_total[city] => 0City
                   [state] => CA
          [total] => 20
       [zip] => 90001
                   [total_w_taxcountry] => 20US
                   [group_name] => General
    )
                )
 
[company_id] => 1
                   [deliveryusername] => Array
first.last@domain.com
                   [two_factor_mode] => (none
                    [0two_factor_key] => stdClass Object
                   [two_factor_pin] => 
   (
                [date_added] => 2014-05-08 21:35:13
         [id] => 2
        [settings] => Array
                   [invoice_id] => 2
  (
                          [method] => email
  ...
                           [date_sentlanguage] => en_us
                        )
   ...
             )
 
            [meta] => Array)
                ()
           [applied_transactions]     )=> Array
 
            [tax_subtotal] => 0(
            [tax_total] => 0
    )
           [taxespayment_url] => Arraydomain.com/billing/client/pay/method/505/?sid=c6V8FU5X%2BdGtT9nZQ5DVOO2SsZdc5hC9k1ct6AiLtBs%3D
           [autodebit_date] =>    (2014-09-22 07:00:00
           [autodebit_date_formatted] => Sep 22,  )2014
        )
)