Jump to content

{Payment_Url} Placeholder Not Available In Invoice Delivery (Unpaid) Template


Greg-Mega

Recommended Posts

I might be using Blesta a little differently to others but I thought it was strange the {payment_url} placeholder wasn't available as an option in the Invoice Delivery (Unpaid) template.

 

I can understand it not being available in the Invoice Delivery (Paid) template.

Link to comment
Share on other sites

Well not sure which one you are on about in the Invoice (Unpaid) 

 

I have this:

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 (No login required)
{% endfor %}
If you have any questions about your invoice, please let us know!

This is the default Blesta one.

Link to comment
Share on other sites

If there was one in there initially I must have removed it because I didn't have a payment gateway written at that point.

 

{invoice.payment_url}

 

Not working I'm afraid. If I add a URL and then use {invoice.payment_url} as the address, I end up with http:// in the email body and that is all.

 

If i add {invoice.payment_url} on a new line on its own without link nothing is shown.

 

Have looked at the HTML source to make sure it wasn't being broken up by markup but it looked OK:

<p>
     <span style="font-family: 'Helvetica Neue', Arial, Verdana, sans-serif; font-size: 12px;">
          {invoice.payment_url}
     </span>
</p>

Are there any other dependencies?

Link to comment
Share on other sites

What is the source of your email template? And what version of Blesta are you using?

 

Version 3.2

<p>
	<span style="font-size:12px;"><span style="font-family:verdana,geneva,sans-serif;">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></span></span><br />
	<span style="font-family: verdana, geneva, sans-serif;">{% endfor %}</span></p>
<p>
	<span style="font-size:12px;"><span style="font-family: verdana, geneva, sans-serif;"><a href="https://{invoice.payment_url}">Pay now</a> (log in not required)</span></span></p>
<p>
	<span style="font-size:12px;"><span style="font-family: verdana, geneva, sans-serif;">If you have any questions about your invoice, please let us know!</span></span></p>

Apologies for the horrible markup.

 

Output is a link to "https://" and no actual URL.

 

The invoice or invoice.payment_url isn't mentioned in the "Available Tags" section so initially i assumed it wasn't possible.

 

 

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

Link to comment
Share on other sites

The problem is the tag you're using for the URL is out of scope.

 

The {invoices} tag is available to the template, and it consists of a list of invoices, so you need to iterate over each one individually. However, your template source is set to only iterate and display the invoice number.

 

When you try to use the {invoice.payment_url} tag, you must do so within the for loop:

{% for invoice in invoices %}

{invoice.payment_url}

{% endfor %}

Based on your email template source, I think you want something like this:

<p>
<span style="font-size:12px;"><span style="font-family:verdana,geneva,sans-serif;">Hi {contact.first_name},<br />
<br />
An invoice has been created for your account and is attached to this email in PDF format.
</p>{% for invoice in invoices %}
<p>
Invoice #:<strong> {invoice.id_code}</strong></span></span><br />
<span style="font-size:12px;"><span style="font-family: verdana, geneva, sans-serif;"><a href="https://{invoice.payment_url}">Pay now</a> (log in not required)</span></span>
</p>{% endfor %}
<p><span style="font-size:12px;"><span style="font-family: verdana, geneva, sans-serif;">If you have any questions about your invoice, please let us know!</span></span></p>
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
Reply to this topic...

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