Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated outdated screenshots


Table of Contents
Table of Contents
maxLevel4
minLevel2
outlinetrue
classtoc

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.

...

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.

Image RemovedImage Added

The tags below are all of those available for this email template. For other email and tag customizations, see Customizing Emails.

TagDescriptionNotesSince Version
{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/

{payment_account.first_name}The first name on the payment account assigned for autodebit
v4.4.0
{payment_account.last_name}The last name on the payment account assigned for autodebit
v4.4.0
{payment_account.account_type}The payment account type that is assigned for autodebiti.e. "cc" or "ach"v4.4.0
{payment_account.last4}The last four digits on the payment account assigned for autodebit
v4.4.0


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] => 
)


Code Block
languagephp
titleThe {invoices} array of objects
collapsetrue
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
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
    [lasttotal_w_nametax] => Last1
        [title] => 
    [company] => Company Co.
    [email] => first.last@domain.com
  )
      [address1] => 123 Main St.
    [address2] => )
    [city] => City
        [statedelivery] => CAArray
     [zip] => 90001
        [country] => stdClass Object(
        (
             [alpha20] => USstdClass Object
            [alpha3] => USA
           (
 [name] => United States
            [alt_name] => 
        )
    [date_addedid] => 2014-05-08 21:35:13
 510
              [contact_type_name] => 
    [contact_type_is_lang] => 
)
Code Block
languagephp
titleThe {invoices} array of objects
collapsetrue
Array (
        [0invoice_id] => stdClass Object
 505
                 (
            [idmethod] => 505email
             [id_format] => {num}
                [iddate_valuesent] => 171
                   [client_id] => 1      )
            [date_billed] => 2014-09-18 07:00:00   )
            [date_duemeta] => 2014-09-23 07:00:00
 Array
              [date_closed] => (
             [date_autodebit] =>    )
            [statustax_subtotal] => active0
            [subtotaltax_total] => 1.00000
            [totaltaxes] => 1.0000Array
             [paid] => 0.0000
   (
              [previous_due] => 829.5010)
            [currencybilling] => stdClass USDObject
            [note_public] => 
     (
       [note_private] => 
            [id_code] => 171
1
                    [deliveryclient_date_sentid] => 1
            [due        [user_id] => 1.0000

                    [linecontact_itemstype] => Array
primary
                    [contact_type_id] => (
                    [0first_name] => stdClass ObjectFirst
                    [last_name] =>   (
       Last
                     [idtitle] => 1181
                            [invoice_id[company] => 505
        Company Co.
                    [service_idemail] => first.last@domain.com
                    [address1] => 123 Main St.
    [description] => Line Item Description
            [address2] => 
              [qty] => 1.0000
    [city] => City
                      [amountstate] => 1.0000CA
                    [zip] => 90001
       [subtotal] => 1.00000000
             [country] => stdClass Object
                  [taxes] => Array
    (
                            (
  [alpha2] => US
                            [alpha3] => )USA
                            [taxes_appliedname] => Array
United States
                            [alt_name] => 
       (
                 )
               )
     [date_added] => 2014-05-08 21:35:13
                    [taxcontact_type_subtotalname] => 0
                            [tax_totalcontact_type_is_lang] => 0
               )
             [totalclient] => stdClass 1Object
               (
              [total_w_tax     [id] => 1
                   [id_format] => {num}
    )
               [id_value] => 1500
       )
            [deliveryuser_id] => Array2
                   (
  [client_group_id] => 1
                   [0primary_account_id] => stdClass Object
                         (
         [primary_account_type] => 
                    [idstatus] => 510active
                   [id_code] => 1500
        [invoice_id] => 505
           [contact_id] => 1
                   [methodfirst_name] => emailFirst
                   [last_name] => Last
        [date_sent] => 
         [company] => Company Co.
             )
      [email] => first.last@domain.com
        )
            [metaaddress1] => Array
123 Main St.
              (
     [address2] => 
         )
            [tax_subtotalcity] => 0City
            [tax_total] => 0
            [taxesstate] => ArrayCA
                (
   [zip] => 90001
           )
        [country] => US
  [billing] => stdClass Object
              [group_name] => (General
                    [company_id] => 1
                    [client_idusername] => 1first.last@domain.com
                    [usertwo_factor_idmode] => none
                    [contacttwo_factor_typekey] => primary
                    [contacttwo_typefactor_idpin] => 
                    [firstdate_nameadded] => First 2014-05-08 21:35:13
                    [last_namesettings] => LastArray
                    [title]  => (
                     [company] => Company Co.
      ...
                           [emaillanguage] => first.last@domain.comen_us
                    [address1] => 123 Main St.
       ...
                     [address2] => )
               )
           [cityapplied_transactions] => CityArray
               (
     [state] => CA
        )
            [zippayment_url] => 90001
        domain.com/billing/client/pay/method/505/?sid=c6V8FU5X%2BdGtT9nZQ5DVOO2SsZdc5hC9k1ct6AiLtBs%3D
            [countryautodebit_date] => stdClass Object2014-09-22 07:00:00
           [autodebit_date_formatted] => Sep 22, 2014
         (
                        )
)


Code Block
languagetext
titleThe {payment_account} object
collapsetrue
A credit card payment account:
stdClass Object
(
    [alpha2id] => US4
    [contact_id] => 1
    [first_name]      => First
            [alpha3[last_name] => USALast
    [address1] => 123 Main St.
                    [name[address2] => United States
    [city] => City
    [state] => CA
    [zip] => 90001
    [country] => US
    [alt_namenumber] =>  d6/No/zCxnjXmcAPxxRvpTm4a84+MiM6IepKj79Nh1gxmDplUl9Gz6ehFLiCjOhDZgGGRHmEx1Z7DRiy+Y97tuAnMi3nEAZppTI4Qs3f8BSZdKWjfGsXiYr9F0miUJ8Ret9/3F+o980q2vQ3SPBIGWk18f0AflMe3R1mapP3IZcrijVpcTYfI1Z99eNmXwcZ5TmeAyqd9+Sj7lbkf2yWtBonMogvrcclH9DhCORW7hQjm2jYFZQT74M6UWT990aOI/yghQVACWWho217vkWB+nwjmBsVbB5QgY/X29BFmjUpmqw73Qi2h/TpYlG3zCFFDrmRyCPy+CjCNWiWxLd/fCd9MR7dXEzEzN/vg3d35nfbM+71vTDRe4SDn4Q9VjQhI7rwDYMlhQ5f7U7HeTt9m/l5ggB7rg//iYoOtTYo+OncN0+qnQ99dQ5pZWatenXfZAhPVDS3eLNdQxZhKpcd2OyU/DjpFEYIA0dytWzbEMWoUO7/rKUv6LvbEpx3M57b
    [expiration] => 202105
    [last4] => 1234
    [type] => mc
    [gateway_id] => )
    [client_reference_id] => 
              [date_added[reference_id] => 2014-05-08 21:35:13
    [status] => active
          [client_id] => 1
    [contact_type_name] => Master Card
    [account_type] => cc
)

An ACH payment account:
stdClass Object
(
    [id] => 2
    [contact_type_is_langid] => 1
    [first_name] => First
    [last_name] => Last
   )
 [address1] => 123 Main   St.
    [clientaddress2] => stdClass Object
    [city] => City
    [state]     (=> CA
    [zip] => 90001
    [country] => US
       [idaccount] => 1
             m6gfz+Ee2SUldJIiBntBfbdnpLSsosZs7GVgpG24N1+IAqjl57RuxnsZU+COFBlwP26r8TzUmiINRrlh6EhsdzTiiFYHtdF1KT4Ht+UYlp7giLKW8tIYF05Xtt5Q+yNIj6zViYGV/6ZjZWNanfIwafwfcrHfqjBFyuY5a+mjOsf1/eW0lc2RyFIMwNFh8uSUM++bTfUEBSxKnEwSb8yQhrrD35CjNlmHn30Hql45nJkPFQEsbUOlNxeiOo/IAwj+J8X3Zc3WKQrFHD/F92XtRpHeYCyRSVF9QaK71qgeyly/H1xdVOGI2bYYgy7ARV071AXXACSOMHAlp88X1BR5Q0wWjspTeBjRN0fDE5UEjKMaLPa777Bcz5BmlmgGm63A994nPl5xK+DDx+e4c54zOJY7gDR/AUnlumAYZ0Dp4XmFRY3uI5qPQ9Iucpui9cWxH4ItC/Jyh0f2gw93qG3EKQAxY/0YMeRKkDlCqo1spdTvU0YowSz6qmJRm57EhugW
       [id_format[routing] => {num}
               e+p5fZGqTYiFzUcM1eHJo15j/lCnuKKPn6aHYy9Sj1/P4kCawX8AUxAJYUp4jGUzuKUuDV+N5P9tQUb85DIeCPrFqb11lRCe6sSjjEbDxNXlgGoILNzx/OZdcqXo5oUqd8Rt/dLpdLrwUPyNOpTQi7xaOh+APiCk5B3rFE7wq4nPjzl+OvQXp28IkN7ehw1ZOnFj8EoTGFDVfNIspYd6IqLiopDOvO2iDesga6YLbnCBJQ/rVMwCF6/jGpgtXMH1YbMq0qNO8jIjrxudFmIF9TaAPxV4UpQ2adl2u5O6iKhqRYeKxpyylZk07CeqI3PZOVHzdHGvo2AILzfA3BJUtzuYCW4nGVNUwfEaUxE12PHUE7GThdkucBtnOBhJBIQlmr6OEwPLYXa7163slmHUQ/wWLPJNfm09eux32KZhxXx1F+oZo4K+nVXQMaZJQPctKUhvcl8Ssb4i+aVOH/Ei7ga+5kuWT+d7Pzycyi5mGp/K+Y9ZiI/wiwstAtJJSwZH
    [id_valuelast4] => 15001112
    [type]          => checking
     [usergateway_id] => 2
                   [client_groupreference_id] => 1
    [reference_id] => 
    [status]     => active
    [primaryclient_account_id] => 
        1
    [type_name] =>  Checking
    [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:

account_type] => ach
)


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:

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

Original Email

Code Block
languagexml
titleHTML (version 4.4.0+)
collapsetrue
<p>Hi {contact.first_name},<br />
<br />
An invoice has been created for your account and is attached to this email in PDF format.<br />
{% for invoice in invoices %}<br />
Invoice #:<strong> {invoice.id_code}</strong></p>

<p>{% if autodebit %}{% if payment_account %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on <strong>{invoice.autodebit_date_formatted}</strong> unless payment has been applied sooner.{% else %}If you would like us to automatically charge your card, login to your account at <a href="http://{client_url}">http://{client_url}</a> to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at <a href="http://{client_url}">http://{client_url}</a> to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at <a href="http://{client_url}">http://{client_url}</a> to set up auto debit.{% endif %}<br />
<br />
<a href="http://{invoice.payment_url}">Pay Now</a> (No login required)<br />
{% endfor %}<br />
If you have any questions about your invoice, please let us know!</p>


Code Block
languagexml
titleText (version 4.4.0+)
collapsetrue
Hi {contact.first_name},

An invoice has been created for your account and is attached to this email in PDF format.
{% for invoice in invoices %}
Invoice #: {invoice.id_code}

{% if autodebit %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted} unless payment has been applied sooner.{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}{% if autodebit %}{% if payment_account %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted} unless payment has been applied sooner.{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}

Pay Now, visit http://{invoice.payment_url} (No login required)
{% endfor %}
If you have any questions about your invoice, please let us know!


Code Block
languagexml
titleHTML (version 3.0.0 up to 4.3.x)
collapsetrue
<p>Hi {contact.first_name},<br />
<br />
An invoice has been created for your account and is attached to this email in PDF format.<br />
{% for invoice in invoices %}<br />
Invoice #:<strong> {invoice.id_code}</strong></p>

<p>{% if autodebit %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on <strong>{invoice.autodebit_date_formatted}</strong> unless payment has been applied sooner.{% else %}If you would like us to automatically charge your card, login to your account at <a href="http://{client_url}">http://{client_url}</a> to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at <a href="http://{client_url}">http://{client_url}</a> to set up auto debit.{% endif %}<br />
<br />
<a href="http://{invoice.payment_url}">Pay Now</a> (No login required)<br />
{% endfor %}<br />
If you have any questions about your invoice, please let us know!</p>


Code Block
languagexml
titleText (version 3.0.0 up to v4.3.x)
collapsetrue
Hi {contact.first_name},

An invoice has been created for your account and is attached to this email in PDF format.
{% for invoice in invoices %}
Invoice #: {invoice.id_code}

{% if autodebit %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted} unless payment has been applied sooner.{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}

Pay Now, visit http://{invoice.payment_url} (No login required)
{% endfor %}
If you have any questions about your invoice, please let us know!
Code Block
languagenone
{% for invoice in invoices %}
Invoice ID: {invoice.id_code}
Amount Due: {invoice.due}
Pay now at https://{invoice.payment_url}.
{% endfor %}