Jump to content
  • 0

Can More Data Become Available To The Email Templates?


gutterboy

Question

Just wondering with regards to the email templates, I notice for example with the "Email Template Invoice Delivery (Unpaid)" template you have the following tags available:

 

{contact.first_name} {contact.last_name} {invoices} {autodebit} {client_url}

 

Just wondering is there an easy way to make other data available to the template such as:

 

Users Address

Last Invoice Amount

Payments/Adjustments (payments since last invoice)

 

Also, is there a page that explains what those tags contain - I know most are self explanatory.

 

Thanks!

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

How can you get it to send? The status of the invoice shows as "Unsent".

Invoices are unsent unless they have been queued and delivered via cron. Sending them manually would not update this status.

 

 

Just wondering with regards to the email templates, I notice for example with the "Email Template Invoice Delivery (Unpaid)" template you have the following tags available:

 

{contact.first_name} {contact.last_name} {invoices} {autodebit} {client_url}

 

Just wondering is there an easy way to make other data available to the template such as:

 

Users Address

Last Invoice Amount

Payments/Adjustments (payments since last invoice)

 

The list of tags are generally a subset of those available, usually showing those most-likely-to-be-used. We haven't yet updated the tag listing to better list each tag in the UI.

 

Users Address

- The address information is available in the {contact} tag, i.e. {contact.address_1}, {contact.address_2}, {contact.city}, {contact.state}, {contact.zip}, {contact.country}

 

Last Invoice Amount

- Blesta doesn't include information on the 'last invoice'. I'm not sure what the 'last invoice' would be, however, the included list of {invoices} have a "previous_due" amount available for each invoice. But since {invoices} is a list of 1 or more invoices, you would likely loop over them to show the amount.

e.g.

----

{% for invoice in invoices}

When this invoice was created, this amount was still outstanding: {invoice.previous_due | currency_format invoice.currency}.

{% endfor %}

----

 

Payments/Adjustments (payments since last invoice)

- Maybe you should clarify this one, but it sounds like all transaction data should be available, which could be an extraordinary amount of information, and I don't see why that would be useful. However, each invoice in the given {invoices} contains the amount that has already been paid toward it.

e.g.

----

{% for invoice in invoices}

This invoice already has already had {invoice.paid | currency_format invoice.currency} paid toward it.

{% endfor %}

----

Link to comment
Share on other sites

  • 0

Last Invoice Amount

- Blesta doesn't include information on the 'last invoice'. I'm not sure what the 'last invoice' would be, however, the included list of {invoices} have a "previous_due" amount available for each invoice. But since {invoices} is a list of 1 or more invoices, you would likely loop over them to show the amount.

e.g.

----

{% for invoice in invoices}

When this invoice was created, this amount was still outstanding: {invoice.previous_due | currency_format invoice.currency}.

{% endfor %}

----

 

Payments/Adjustments (payments since last invoice)

- Maybe you should clarify this one, but it sounds like all transaction data should be available, which could be an extraordinary amount of information, and I don't see why that would be useful. However, each invoice in the given {invoices} contains the amount that has already been paid toward it.

e.g.

----

{% for invoice in invoices}

This invoice already has already had {invoice.paid | currency_format invoice.currency} paid toward it.

{% endfor %}

----

 

This sounds like an excellent way to include overdue balances in invoice emails.  Though I just wanted to clarify before I add it...

 

below code will calculate to sum total of all outstanding unpaid invoices?

{% for invoice in invoices}
When this invoice was created, this amount was still outstanding: {invoice.previous_due | currency_format invoice.currency}.
{% endfor %}

 

and this will only show what amount has been paid to a specific invoice?

{% for invoice in invoices}
This invoice already has already had {invoice.paid | currency_format invoice.currency} paid toward it.
{% endfor %}

 

I don't quite understand why one would apply to all invoices, and the other would only apply to the specific invoice, since they are both using {% for invoice in invoices}

Link to comment
Share on other sites

  • 0

Thanks for the great post Tyson!

 

Invoices are unsent unless they have been queued and delivered via cron. Sending them manually would not update this status.

 

Ok thanks. I think I was getting confused with the "adding" of invoices and the "sending" of them. We may have to enable the cron for some things, still to get to that point of working it all out.

 

Blesta doesn't include information on the 'last invoice'. I'm not sure what the 'last invoice' would be

 

Last invoice meaning the previous new invoice they received before this one.

 


Maybe you should clarify this one, but it sounds like all transaction data should be available, which could be an extraordinary amount of information, and I don't see why that would be useful. However, each invoice in the given {invoices} contains the amount that has already been paid toward it.

 

Well I guess what we're trying to show is something like..

 

Outstanding Balance - $95.00

Payments/Adjustments - $40.00

This Invoice - $15.00

Total Due - $70.00

Link to comment
Share on other sites

  • 0

This sounds like an excellent way to include overdue balances in invoice emails.  Though I just wanted to clarify before I add it...

 

below code will calculate to sum total of all outstanding unpaid invoices?

{% for invoice in invoices}
When this invoice was created, this amount was still outstanding: {invoice.previous_due | currency_format invoice.currency}.
{% endfor %}

 

No, this does not calculate a sum. This only displays each invoice's previous due amount, e.g.

{% for invoice in invoices}
Invoice: #{invoice.id_code}
Invoice Total: {invoice.due | currency_format invoice.currency}
Previous Due: {invoice.previous_due | currency_format invoice.currency}
{% endfor %}

--
Invoice: #1003
Invoice Total: $20.00
Previous Due: $50.00

Invoice: #1002
Invoice Total: $40.00
Previous Due: $10.00

Invoice: #1001
Invoice Total: $10.00
Previous Due: $0.00

and this will only show what amount has been paid to a specific invoice?

{% for invoice in invoices}
This invoice already has already had {invoice.paid | currency_format invoice.currency} paid toward it.
{% endfor %}

Yes, it will show how much was paid to each invoice, e.g.

This invoice already has already had $0.00 paid toward it.
This invoice already has already had $10.00 paid toward it.
This invoice already has already had $15.25 paid toward it.

Well I guess what we're trying to show is something like..

 

Outstanding Balance - $95.00

Payments/Adjustments - $40.00

This Invoice - $15.00

Total Due - $70.00

Sounds like you're going for kind-of a "invoices summary/overview", which may be better suited to a new email template instead. The scope of the Invoice Delivery (Unpaid) template is mainly to notify a client of that specific invoice (or set of invoices). But I can see how additional outstanding/paid/due totals might be useful as well.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...