Jump to content
  • 0

Can More Data Become Available To The Email Templates?


Question

Posted

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!

20 answers to this question

Recommended Posts

  • 0
Posted

That's a feature request for more tags, but I believe you can do what you like using the current tags {invoices.______} the guys will be able to tell you. If you would like to know now, you can use {% debug %} and email yourself that template and you will get all the tags you can use.

  • 0
Posted

Ok thanks. Cron is off because we send the invoices ourselves via our main system via the API.

 

Ah have you only disabled the deliver invoices on: /settings/company/automation/ (Deliver Invoices)

  • 0
Posted

Ah have you only disabled the deliver invoices on: /settings/company/automation/ (Deliver Invoices)

 

Well, this is all still on a test site atm....... so I think all of them are disabled as no crons have been setup.

  • 0
Posted

I had a look at the tags available and it doesn't seem these two are:

 

Last Invoice Amount

Payments/Adjustments (payments since last invoice)

 

Anyone know if it's easy to add your own tags?

 

Best to open a feature request for such tags as they need to some how be made into the core.

  • 0
Posted

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 %}

----

  • 0
Posted

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}

  • 0
Posted

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

  • 0
Posted

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.

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...