Image in Email Campaign

First off, my set up is:
Debian 9
Package contents
Apache 2.4.33
MySQL 5.7.22
OpenSSL 1.0.2o
PHP 7.0.30
phpMyAdmin 4.8.1
SQLite 3.18.0
SuiteCRM 7.10.7

I am testing email campaigns. When I add an image to the email template and save it, we can see in the /public/ directory (watching as admin on the server) the image appear with it’s name assigned a random string of characters. I.e. we can see the image is being uploaded.

In fact, selecting /public/randomstring.png where randomstring= the random string assigned by SuiteCRM, we can access the image in a browser.

But, when the message is sent the image does not appear in the email. We can’t figure out why this is occurring.

Any help or guidance is appreciated.

Thanks,

jfd118

I have just sent an email campaign from SuiteCRM 7.10.7

Had a similar issue

Couple things

When adding images into the “source URL” - are you adding the full CRM URL?

One thing I did different to get them through is create my own /images/ folder on the server and upload via FileZilla

Then used full url/images/image.jpg

And check these values in your config.php

site_url
host_name

Two with_in :: site_url and host_name with the full subdomain: https:// suitecrm.mysite.com

And the image does not show on any Email templates, I have been trying for months now. still no picture…

I have them like this, notice the slight difference (and avoid any slashes “/” at the end):


  'host_name' => 'www.mydomain.org',
  'site_url' => 'http://www.mydomain.org',

In your browser, when you’re looking at the page, is the link to the broken image well formed?Does it show the correct URL for your host?

If you increase permissions on the image dir and file, does it solve the problem?

What about removing the image from the template, and adding it again?

I have this issue all the time. Let’s say your site is at https://mysite.com then you add a picture and it creates a relational link like … /cache/images/myimage.jpg looks great.

But… then when you send the email, for some reason it doesn’t put in the https://mysite.com/ in front of it like it should do and the emails image links don’t work. What I normally do is just edit the link inserted in the email to http://mysite/cache/images/myimage.jpg (noticed I changed it to http). Then of course it redirects to HTTPS and gets the image, but I guess SuitCRM thinks its an external link now so it puts in the whole URL and not just the relational part. I suspect this is a bug because the email that gets sent includes a relational URL and not the full URL of the image (unless you do my workaround).

So, what this boils down to is

  1. In SuiteCRM 7.10.9,
  2. Start editing an email template
  3. Add an image
  4. The URL is improperly formed, it is missing the domain name

Is this it? Does the issue exist on Github?

Yes, that’s exactly what happens @pgr

Looks similar to this issue on Github. But in my experience, it’s not just campaigns that cause the problem but all email templates.

5662

Someone suggested a code fix, haven’t tried it yet.

Makes sense, because the code for Email templates in Campaigns is exactly the same as for any other Email Templates.

Can you please try the fix? If it works I can try pushing to have this included soon. Since the fix is not in a PR, it is going completely unnoticed on GitHub…

:woohoo: :woohoo: :woohoo:
Thanks @pgr for comment before that. I found that Image issues are not displayed in Back_end of templete email and also will not display in email when received. (1) chmod and the (2) site_url and (3) host_name structure. I have tried to implement these 3 subsections and have succeeded.

 As @pgr wrote upper:
 'host_name' => 'www.mydomain.org',
  'site_url' => 'http://www.mydomain.org',
 and Chmod to right :
Chmod 755 folder: Cache and Images (into: your_site/cache/images/)

Perfect now, @pstevens let’s a check and follow one time again !

Hello,

What exactly is “the fix”? I ask because we already arrived at the configuration changes suggested during our testing but it did not solve the problem.

I.e. we are already at

"As @pgr wrote upper:
‘host_name’ => ‘www.mydomain.org’,
‘site_url’ => ‘http://www.mydomain.org’,

and Chmod to right :
Chmod 755 folder: Cache and Images (into: your_site/cache/images/)"

but it does not resolve the issue.

Thanks,

jfd118

There are two different things that people are claiming is “a fix”:

  • one is in https://github.com/salesagility/SuiteCRM/issues/5662 , you have to read the text and see what some users advise.

  • the other are these changes to settings and permissions. Note that permissions can be tricky, I’ve seen a thousand times people think they have set permissions correctly, when they really haven’t. The most common mistake is not even knowing which user your web server is running under, and failing to set ownerships correctly.

Ok so I’ve done some testing, here’s what I’ve learned:

  1. The proposed fixes on Github don’t work. (I tried them both).
  2. It’s not a security issue or a site URL issue, I know this because .PNG files work. (and my permissions and site url are good).
  3. If you upload a .PNG file works no problem and sends email with proper embedded image.
  4. If you usea .JPG it shows in editor, but when you save it disappears and also does not send it in the email.
  5. .GIF files will not upload at all.

I reported an issue Email module: Why is the inserted image not shown in the received email?

I am wondering are these two issues related?

B-) check for you right !


 'host_name' => 'www.mydomain.org',
 'site_url' => 'http://www.mydomain.org',  <--- Full URL with http:// or https://

Tried a PNG file - it doesn’t work either.
Symptoms are a bit different.
With JPG the received email has broken links where the image was.
With PNG there is no indication of an image at all.

Both JPG and PNG images display and save just fine in the template editor.

Suitecrm 7.11.1

So, it seems this is still an issue.

We’ve been doing pretty well saleswise with networking based lead gen but now need to build pipeline with some email campaigns. No images planned.

According to the release notes of 7.11.3, the problem this thread discusses was fixed.
https://github.com/salesagility/SuiteCRM/issues/5662

I just upgraded to 7.11.3 and conducted a test that seems to have failed. My process was:

  1. Create a new email template
  2. Insert an image to into the template. Save the template.
  3. I selected my email address from the “targets” list and the email editor pops up.
  4. I select the template. The template has a place holder for the image but image is not there.
  5. Send the email to myself.
  6. Receive email. Only a placeholder for the image is in the message. The image itself is not.

Has anyone else tested the solution?

jfd118

That fix was for Mozaik. Are you using that to edit your Emails?

You select that in your User’s profile.

If you are using Mozaik, then please post in the GitHub Issue, so the developer will see it. Thanks.

Yes. I’m using Moziak. I’ll make the submission.

Jan