You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ingo Wolfmayr <in...@wolfix.at> on 2022/04/11 09:06:36 UTC
Images in email
Hi everybody,
I just stumpled over a problem when sending an order confirmation.
A simple HTML template with a web link to an image:
<div>
<div>TEST</div>
<a href="#">
<img src="https://ofbizdomain/images/ofbiz_logo.png"
style="display: block; max-height:98px; max-width:98px;" alt="" max-height="98" border="0" max-width="98">
</a>
</div>
The above template fires an error (image url from ofbiz domain): java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
The below template is send without errors (image url from external domain):
<div>
<div>TEST</div>
<a href="#">
<img src="https://ofbiz.apache.org/images/ofbiz_logo.png"
style="display: block; max-height:98px; max-width:98px;" alt="" max-height="98" border="0" max-width="98">
</a>
</div>
Both image urls are valid. Can someone give me a hint on how to proceed. The stack trace does not help very much.
I am working in trunk.
Best regards,
Ingo
AW: Images in email
Posted by Ingo Wolfmayr <in...@wolfix.at>.
I found my problem and the solutions. I have to set the allowedProtocols in security.properties in order to allow urls from my domain as it is not included in the top level domains defined in UtilHttp.java.
-----Ursprüngliche Nachricht-----
Von: Ingo Wolfmayr <in...@wolfix.at>
Gesendet: Montag, 11. April 2022 13:06
An: user@ofbiz.apache.org
Betreff: AW: Images in email
Hi Daniel,
no. Right now I copy the example html template in the content field of the confirmationmailedit form that can be found on the order (send confirmation link) - for testing.
All SSL certificates are fine.
Best regards,
Ingo
-----Ursprüngliche Nachricht-----
Von: Daniel Watford <da...@foomoo.co.uk>
Gesendet: Montag, 11. April 2022 11:36
An: user@ofbiz.apache.org
Betreff: Re: Images in email
Hi Ingo,
Are you using a template to produce a PDF (from HTML) to send as an email attachment?
If so you might be running into a certificate issue with your domain. I can't dig into it too much, but if the process executing the template cannot ensure 'ofbizdomain' has a valid certificate then it will fail to retrieve the image content to embed in the PDF file.
Can you use http rather than https to access your image?
On Mon, 11 Apr 2022 at 10:06, Ingo Wolfmayr <in...@wolfix.at> wrote:
> Hi everybody,
>
> I just stumpled over a problem when sending an order confirmation.
>
> A simple HTML template with a web link to an image:
>
> <div>
> <div>TEST</div>
> <a href="#">
> <img src="
> https://ofbizdomain/images/ofbiz_logo.png"
> style="display: block;
> max-height:98px; max-width:98px;" alt="" max-height="98" border="0" max-width="98">
> </a>
> </div>
>
> The above template fires an error (image url from ofbiz domain):
> java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length
> 0
>
> The below template is send without errors (image url from external domain):
>
> <div>
> <div>TEST</div>
> <a href="#">
> <img src="
> https://ofbiz.apache.org/images/ofbiz_logo.png"
> style="display: block;
> max-height:98px; max-width:98px;" alt="" max-height="98" border="0" max-width="98">
> </a>
> </div>
>
> Both image urls are valid. Can someone give me a hint on how to proceed.
> The stack trace does not help very much.
>
> I am working in trunk.
>
> Best regards,
> Ingo
>
>
--
Daniel Watford
AW: Images in email
Posted by Ingo Wolfmayr <in...@wolfix.at>.
Hi Daniel,
no. Right now I copy the example html template in the content field of the confirmationmailedit form that can be found on the order (send confirmation link) - for testing.
All SSL certificates are fine.
Best regards,
Ingo
-----Ursprüngliche Nachricht-----
Von: Daniel Watford <da...@foomoo.co.uk>
Gesendet: Montag, 11. April 2022 11:36
An: user@ofbiz.apache.org
Betreff: Re: Images in email
Hi Ingo,
Are you using a template to produce a PDF (from HTML) to send as an email attachment?
If so you might be running into a certificate issue with your domain. I can't dig into it too much, but if the process executing the template cannot ensure 'ofbizdomain' has a valid certificate then it will fail to retrieve the image content to embed in the PDF file.
Can you use http rather than https to access your image?
On Mon, 11 Apr 2022 at 10:06, Ingo Wolfmayr <in...@wolfix.at> wrote:
> Hi everybody,
>
> I just stumpled over a problem when sending an order confirmation.
>
> A simple HTML template with a web link to an image:
>
> <div>
> <div>TEST</div>
> <a href="#">
> <img src="
> https://ofbizdomain/images/ofbiz_logo.png"
> style="display: block;
> max-height:98px; max-width:98px;" alt="" max-height="98" border="0" max-width="98">
> </a>
> </div>
>
> The above template fires an error (image url from ofbiz domain):
> java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length
> 0
>
> The below template is send without errors (image url from external domain):
>
> <div>
> <div>TEST</div>
> <a href="#">
> <img src="
> https://ofbiz.apache.org/images/ofbiz_logo.png"
> style="display: block;
> max-height:98px; max-width:98px;" alt="" max-height="98" border="0" max-width="98">
> </a>
> </div>
>
> Both image urls are valid. Can someone give me a hint on how to proceed.
> The stack trace does not help very much.
>
> I am working in trunk.
>
> Best regards,
> Ingo
>
>
--
Daniel Watford
Re: Images in email
Posted by Daniel Watford <da...@foomoo.co.uk>.
Hi Ingo,
Are you using a template to produce a PDF (from HTML) to send as an email
attachment?
If so you might be running into a certificate issue with your domain. I
can't dig into it too much, but if the process executing the template
cannot ensure 'ofbizdomain' has a valid certificate then it will fail to
retrieve the image content to embed in the PDF file.
Can you use http rather than https to access your image?
On Mon, 11 Apr 2022 at 10:06, Ingo Wolfmayr <in...@wolfix.at> wrote:
> Hi everybody,
>
> I just stumpled over a problem when sending an order confirmation.
>
> A simple HTML template with a web link to an image:
>
> <div>
> <div>TEST</div>
> <a href="#">
> <img src="
> https://ofbizdomain/images/ofbiz_logo.png"
> style="display: block; max-height:98px;
> max-width:98px;" alt="" max-height="98" border="0" max-width="98">
> </a>
> </div>
>
> The above template fires an error (image url from ofbiz domain):
> java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
>
> The below template is send without errors (image url from external domain):
>
> <div>
> <div>TEST</div>
> <a href="#">
> <img src="
> https://ofbiz.apache.org/images/ofbiz_logo.png"
> style="display: block; max-height:98px;
> max-width:98px;" alt="" max-height="98" border="0" max-width="98">
> </a>
> </div>
>
> Both image urls are valid. Can someone give me a hint on how to proceed.
> The stack trace does not help very much.
>
> I am working in trunk.
>
> Best regards,
> Ingo
>
>
--
Daniel Watford