You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Table of Contents

Description

This email template is sent when a scheduled unpaid invoice is delivered to the client. It will contain a PDF attachment of the invoice. Each of the clients' billing contacts will receive this email if any are set, otherwise the primary contact will receive the email.

Supported Tags

The tags described in Blesta are only a list of commonly-used tags, for brevity.

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.

The tags below are all of those available for this email template. For other email and tag customizations, see 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/

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.

The {contact} object
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] => 
)
The {invoices} array of objects
Array (
    [0] => stdClass Object
        (
            [id] => 505
            [id_format] => {num}
            [id_value] => 171
            [client_id] => 1
            [date_billed] => 2014-09-18 07:00:00
            [date_due] => 2014-09-23 07:00:00
            [date_closed] => 
            [date_autodebit] => 
            [status] => active
            [subtotal] => 1.0000
            [total] => 1.0000
            [paid] => 0.0000
            [previous_due] => 829.5010
            [currency] => USD
            [note_public] => 
            [note_private] => 
            [id_code] => 171
            [delivery_date_sent] => 
            [due] => 1.0000
            [line_items] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => 1181
                            [invoice_id] => 505
                            [service_id] => 
                            [description] => Line Item Description
                            [qty] => 1.0000
                            [amount] => 1.0000
                            [subtotal] => 1.00000000
                            [taxes] => Array
                                (
                                )
                            [taxes_applied] => Array
                                (
                                )
                            [tax_subtotal] => 0
                            [tax_total] => 0
                            [total] => 1
                            [total_w_tax] => 1
                        )
                )
            [delivery] => Array
                (
                     [0] => stdClass Object
                         (
                             [id] => 510
                             [invoice_id] => 505
                             [method] => email
                             [date_sent] => 
                         )
                )
            [meta] => Array
                (
                )
            [tax_subtotal] => 0
            [tax_total] => 0
            [taxes] => Array
                (
                )
            [billing] => 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] => 
               )
           [client] => stdClass Object
               (
                   [id] => 1
                   [id_format] => {num}
                   [id_value] => 1500
                   [user_id] => 2
                   [client_group_id] => 1
                   [primary_account_id] => 
                   [primary_account_type] => 
                   [status] => active
                   [id_code] => 1500
                   [contact_id] => 1
                   [first_name] => First
                   [last_name] => Last
                   [company] => Company Co.
                   [email] => first.last@domain.com
                   [address1] => 123 Main St.
                   [address2] => 
                   [city] => City
                   [state] => CA
                   [zip] => 90001
                   [country] => US
                   [group_name] => General
                   [company_id] => 1
                   [username] => first.last@domain.com
                   [two_factor_mode] => none
                   [two_factor_key] => 
                   [two_factor_pin] => 
                   [date_added] => 2014-05-08 21:35:13
                   [settings] => Array
                       (
                           ...
                           [language] => en_us
                           ...
                       )
               )
           [applied_transactions] => Array
               (
               )
           [payment_url] => domain.com/billing/client/pay/method/505/?sid=c6V8FU5X%2BdGtT9nZQ5DVOO2SsZdc5hC9k1ct6AiLtBs%3D
           [autodebit_date] => 2014-09-22 07:00:00
           [autodebit_date_formatted] => Sep 22, 2014
       )
)

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 field that uniquely identifies the invoice to be paid. You can iterate over each invoice in the template to set the link. Consider the following example where invoice information is set, encapsulated in a for loop:

{% for invoice in invoices %}
Invoice ID: {invoice.id_code}
Amount Due: {invoice.due}
Pay now at https://{invoice.payment_url}.
{% endfor %}
  • No labels