Suitecrm: Email Quotation do not rewrite image url so you can't see it in email

Created on 18 Dec 2017  路  5Comments  路  Source: salesagility/SuiteCRM



Issue

When you email a Quotation with a template you create with PDF Template, and this template includes a local image like: "themes/default/images/company_logo.png" this URL image is sent via email.... It should be rewritten like: https://demo.suitecrm.nube.coop/themes/default/images/company_logo.png
If not, the image is not loaded in the email.

Expected Behavior

The img tag shoud be something like:

<img style="float:left;" src="https://demo.suitecrm.nube.coop/themes/default/images/company_logo.png" alt="">

Actual Behavior


The img tag is:

<img style="float:left;" src="themes/default/images/company_logo.png" alt="">

Possible Fix

Steps to Reproduce


  1. Create a Quote Template, and load an sample.

pdf_templates_1

  1. You can verify the img tag and its url

pdf_templates_2

  1. Send a Quotation by email, and verify that the image is shown:

pdf_templates_3

  1. When you receive the email the image is not shown:

pdf_templates_4

  1. If you verify email code, you will see the img tag is no rewritten:

<img style="float:left;" src="themes/default/images/company_logo.png" alt="">

Context


Your Environment

  • SuiteCRM Version used: 7.9.x and 7.10-beta2
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 57
  • Environment name and version (e.g. MySQL, PHP 7): MySQL 5.7, PHP 5.6 and PHP 7.0
  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 16.04 and 17.10
Important Fix Proposed Bug

All 5 comments

Hi @PedroErnst !!

Thanks for your patch!!

I think the URL of the image should be created this way:

$logoUrl = $baseUrl . '/' . $logoUrlArr[0].'?'.$logoUrlArr[1];

If we do this way, the proxies will manage the cache in a better way.

Anyway I apply your patch, but I think the WYSIWYG email composer manipulates the images urls:

mail

Hi Abuelodelanada,

Yes you're absolutely right. I just checked and indeed the correct URL is saved in the DB, then also correctly loaded into the email module, but at some point it gets replaced by the incomplete version.

Ok that problem should be solved now as well with the last commit. On my end the emails arrive correctly with the full URL.

Let me know if there are any issues.

Hi @PedroErnst

It works!

@Dillon-Brown In order to have this patch in 7.10 this pull request should be done in hotfix branch?

https://github.com/salesagility/SuiteCRM/pull/4739

@Abuelodelanada It's currently pointed to develop so it will only end up in 7.10. It will need to be remade or I will duplicate it for 7.9.x.

Was this page helpful?
0 / 5 - 0 ratings