Email Template issue

I get an “undefined” error when I try to send out an email based on a pre-built template. What am I doing wrong?

I am also unable to attach the screenshot that I took for this issue.

Thank you in advance for any help.

John

Version 7.9.3 has just been released and it solves quite a lot of Email bugs. You can start by upgrading and retrying to see if your problem is solved.

If not, you need to explain a little better… you can upload images in many sites online, like PasteBoard, or imgur.com, and then paste the link here.

Thanks

No Change in 7.9.3, still get an undefined error.

User Action

  • Click on contact to create new message
  • select email template
  • receive an Undefined error (link to image below)

We’ll have to investigate further, then… can I please ask you for additional info:

  1. Your versions of OS, Web server, PHP, database?

  2. Do you have any significant messages (ERROR, FATAL) in your logs?

  3. Is this a new installation? Or one that used to work fine before an upgrade? Do you have any customizations?

  4. Can you please post the results of this command, from the root directory of yuor SuiteCRM installation?

ls -al

This will give me a quick glance of how your permissions look.

Thanks

Server Information

Server Information
Item Detail
Hosting Package Power
Server Name ecbiz213
cPanel Version 60.0 (build 43)
Apache Version 2.4.25
PHP Version unknown
MySQL Version 5.6.34
Architecture x86_64
Operating System linux
Shared IP Address 144.208.77.68
Path to Sendmail /usr/sbin/sendmail
Path to Perl /usr/bin/perl
Perl Version 5.16.3
Kernel Version 3.10.0-427.36.1.lve1.4.40.el7.x86_64

LOG:

ue Jul 18 11:51:52 2017 [954914][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone=“UTC” in php.ini!
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21077” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21074” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21073” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21072” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21071” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21029” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21025” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21024” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21022” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21021” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21019” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21013” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21012” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21011” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “21005” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “20998” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “20997” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “20996” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails., users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “20995” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT emails.
, users.user_name as assigned_user_name
FROM emails
LEFT JOIN users ON emails.assigned_user_id=users.id
WHERE emails.uid LIKE “20965” AND emails.deleted=0
ORDER BY date_sent DESC: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT meetings.id, name,reminder_time, description,location, status, parent_type, parent_id, date_start, assigned_user_id
FROM meetings LEFT JOIN meetings_users ON meetings.id = meetings_users.meeting_id
WHERE meetings_users.user_id =‘1’
AND meetings_users.accept_status != ‘decline’
AND meetings.reminder_time != -1
AND meetings_users.deleted != 1
AND meetings.status = ‘Planned’
AND date_start >= ‘2017-07-18 11:51:57’
AND date_start <= ‘2017-07-19 12:51:57’: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed:
SELECT calls.id, name, reminder_time, description, date_start, status, parent_type, parent_id
FROM calls LEFT JOIN calls_users ON calls.id = calls_users.call_id
WHERE calls_users.user_id =‘1’
AND calls_users.accept_status != ‘decline’
AND calls.reminder_time != -1
AND calls_users.deleted != 1
AND calls.status = ‘Planned’
AND date_start >= ‘2017-07-18 11:51:57’
AND date_start <= ‘2017-07-19 12:51:57’: MySQL error 2006: MySQL server has gone away
Tue Jul 18 07:52:33 2017 [955210][1][FATAL] Query Failed: SELECT reminders.* , jt0.user_name modified_by_name , jt0.created_by modified_by_name_owner , ‘Users’ modified_by_name_mod , jt1.user_name created_by_name , jt1.created_by created_by_name_owner , ‘Users’ created_by_name_mod , jt2.user_name assigned_user_name , jt2.created_by assigned_user_name_owner , ‘Users’ assigned_user_name_mod FROM reminders LEFT JOIN users jt0 ON reminders.modified_user_id=jt0.id AND jt0.deleted=0

AND jt0.deleted=0 LEFT JOIN users jt1 ON reminders.created_by=jt1.id AND jt1.deleted=0

AND jt1.deleted=0 LEFT JOIN users jt2 ON reminders.assigned_user_id=jt2.id AND jt2.deleted=0

AND jt2.deleted=0 where (reminders.popup = 1) AND reminders.deleted=0: MySQL error 2006: MySQL server has gone away

Response to the ls -al command:

[compos24@ecbiz213 dir]$ ls -al
total 13600
drwxr-xr-x 22 compos24 compos24 4096 Jul 18 08:04 ./
drwxr-x— 6 compos24 nobody 4096 Jul 18 07:43 …/
-rw-r–r-- 1 compos24 compos24 1661 Jun 13 18:43 .htaccess
drwxr-xr-x 3 compos24 compos24 4096 Jan 12 2017 C:/
-rw-r–r-- 1 compos24 compos24 2811 Nov 15 2016 HandleAjaxCall.php
-rw-r–r-- 1 compos24 compos24 34539 Nov 15 2016 LICENSE.txt
drwxr-xr-x 3 compos24 compos24 4096 Jan 9 2017 ModuleInstall/
-rw-r–r-- 1 compos24 compos24 2659 Jul 11 18:55 README.md
-rw-r–r-- 1 compos24 compos24 5327 Nov 15 2016 SugarSecurity.php
-rw-r–r-- 1 compos24 compos24 5843 Nov 15 2016 TreeData.php
drwxr-xr-x 2 compos24 compos24 4096 Jan 9 2017 XTemplate/
drwxr-xr-x 8 compos24 compos24 4096 Jan 9 2017 Zend/
drwxr-xr-x 15 compos24 compos24 4096 Feb 20 10:44 cache/
-rw-r–r-- 1 compos24 compos24 3590 Nov 15 2016 campaign_tracker.php
-rw-r----- 1 compos24 compos24 10964 Jul 11 18:57 config.php
-rw-r–r-- 1 compos24 compos24 1126 Jul 18 07:52 config_override.php
-rw-r–r-- 1 compos24 compos24 5052 Jul 11 18:55 cron.php
-rw-r–r-- 1 compos24 compos24 2446 Nov 15 2016 crossdomain.xml
drwxr-xr-x 11 compos24 compos24 4096 Mar 21 16:46 custom/
drwxr-xr-x 3 compos24 compos24 4096 Feb 20 10:47 data/
-rw-r–r-- 1 compos24 compos24 2388 Nov 15 2016 dictionary.php
-rw-r–r-- 1 compos24 compos24 12541 Jul 11 18:55 download.php
-rw-r–r-- 1 compos24 compos24 2392 Nov 15 2016 emailmandelivery.php
-rw-r–r-- 1 compos24 compos24 4912 Nov 15 2016 export.php
-rw-r–r-- 1 compos24 compos24 967627 Nov 15 2016 files.md5
drwxr-xr-x 3 compos24 compos24 4096 Feb 12 18:19 http:/
drwxr-xr-x 3 compos24 compos24 4096 Jun 13 16:03 https:/
-rw-r–r-- 1 compos24 compos24 2371 Nov 15 2016 ical_server.php
drwxr-xr-x 57 compos24 compos24 4096 Jul 11 18:55 include/
-rw-r–r-- 1 compos24 compos24 2374 Nov 15 2016 index.php
drwxr-xr-x 6 compos24 compos24 4096 Feb 12 18:21 install/
-rw-r–r-- 1 compos24 compos24 30016 Nov 15 2016 install.php
-rw-r–r-- 1 compos24 compos24 13373 Nov 15 2016 json_server.php
drwxr-xr-x 3 compos24 compos24 4096 Feb 12 18:21 jssource/
-rw-r–r-- 1 compos24 compos24 2313 Nov 15 2016 log_file_restricted.html
-rw-r–r-- 1 compos24 compos24 2376 Nov 15 2016 maintenance.php
drwxr-xr-x 2 compos24 compos24 4096 Jul 11 18:55 metadata/
drwxr-xr-x 112 compos24 compos24 4096 Feb 12 18:22 modules/
-rw-r–r-- 1 compos24 compos24 2890 Nov 15 2016 pdf.php
-rw-r–r-- 1 compos24 compos24 352 Jul 18 07:44 php.ini
drwxr-xr-x 2 compos24 compos24 4096 Feb 12 18:24 public/
drwxr-xr-x 3 compos24 compos24 4096 Feb 20 17:50 public_html/
-rw-r–r-- 1 compos24 compos24 73 Nov 15 2016 robots.txt
-rw-r–r-- 1 compos24 compos24 3588 Nov 15 2016 run_job.php
drwxr-xr-x 11 compos24 compos24 4096 Feb 12 18:24 service/
drwxr-xr-x 2 compos24 compos24 4096 Feb 12 18:24 soap/
-rw-r–r-- 1 compos24 compos24 4091 Nov 15 2016 soap.php
-rw-r–r-- 1 compos24 compos24 154 Nov 15 2016 sugar_version.json
-rw-r–r-- 1 compos24 compos24 2263 Nov 15 2016 sugar_version.php
-rw-r–r-- 1 compos24 compos24 0 Jan 9 2017 sugarcrm.log
-rw-r–r-- 1 compos24 compos24 82210 Jul 18 08:04 suitecrm.log
-rw-r–r-- 1 compos24 compos24 10485903 Jul 12 22:46 suitecrm_1.log
-rw-r–r-- 1 compos24 compos24 169 Jul 11 18:55 suitecrm_version.php
drwxr-xr-x 6 compos24 compos24 4096 Feb 12 18:24 themes/
-rw-r–r-- 1 compos24 compos24 1962150 Jul 11 18:57 upgradeWizard.log
drwxr-xr-x 6 compos24 compos24 61440 Jul 17 14:50 upload/
-rw-r–r-- 1 compos24 compos24 2980 Nov 15 2016 vCard.php
-rw-r–r-- 1 compos24 compos24 2707 Nov 15 2016 vcal_server.php

php.ini configuration:

display_errors = Off
date.timezone = “America/New_York”
max_execution_time = 3000
max_input_time = 3000
max_input_vars = 10000
memory_limit = 500M
upload_max_filesize = 7000000

Also, where should the php.ini file be located at? I seem to have it in three different directories. I imagine that there should only be one?

Thanks for all of your help!!

John

Ok, a few things…

  1. It would still be nice to know your version of PHP

  2. It would still be nice to know if this is a new install or not

  3. You shouldn’t post this much information and leave something like your IP address as part of it… you’re exposing yourself to malicious attacks, and giving them details on your system…

  4. Those SQL errors look like there is something very wrong with your database, can you check logs/repair it?

  5. There are two php.ini you need to care about, one for Apache (the SuiteCRM web app) and one for Command-line (CLI - for cron jobs). The pathname usually makes it obvious which one it is. But if necessary, you can run php -i from your command-line to learn about the CLI version and ini location, and you can go in SuiteCRM Admin/Diagnostics and get a phpinfo report to see the ini location for Apache. Make sure you set timezone correctly in both.

You must debug your system until it is showing zero FATAL errors, otherwise things will break randomly…

Good luck!

PHP version 5.5

It can be 5.3, 5.4, 5.5, 5.6, 7.0 and 7.1.

Please advise which to use.

Should the php.ini versions be identical?

Thank you so much!

John

  1. I would recommend using the hightest PH that works for you. I’m using 7.0 and it’w working great. Some people have reported with 7.1 they can’t even get the application to work (so you can try it, if it doesn’t work, go back to 7.0).

  2. Your concern with php.ini is just to get rid of the FATAL error regarding the timezone. Just include that directive in all of them.

  3. After the PHP version upgrade, check if you still have those MySQL errors in your logs. Pay attention to the times of the log messages. If they persist, you need to somehow troubleshoot your database…

OK…I changed the PHP version to 7.0 and fixed the time zone error by making all versions of php.ini files recursive. My log file is now empty. I still get the email template error.

I think it is in the software at this point.

I do use the email template alot so it would be great to see this resolved.

Let me know how I can help.

Kindest regards

John

This progress you’ve made is very important, your system is much better now.

About the templates issue, I was able to reproduce it also in my system, and I went to look for it in GitHub and it’s already there:

https://github.com/salesagility/SuiteCRM/issues/3735

Hopefully they’d find a fix soon. I use this feature daily and not having it means doing it manually in Outlook. Which is a bit time consuming. I like the fact that the map module works now.

I appreciate all of your help. Very much so.

Cheers

John

Have you tried simply hitting the “OK” button in that error message that says “undefined”? For me, that fills the template correctly. So, it’s still a bug, but at least I can work around it.

I have. I was only able to get one email to go out. It did not fill in the subject line or attach the files that were part of the template. Basically it’s useless in its current functionality.

Now, this error showed up in the log:

Tue Jul 18 11:40:47 2017 [452602][1][FATAL] emails_email_templates for emails_email_templates failed to load

Tue Jul 18 11:40:47 2017 [452602][1][FATAL] Failed to load relationship emails_email_templates while saving Emails
Tue Jul 18 11:40:49 2017 [452857][1][FATAL] emails_email_templates_idb for emails_email_templates failed to load

Tue Jul 18 11:40:54 2017 [453214][1][FATAL] emails_email_templates_idb for emails_email_templates failed to load

Tue Jul 18 11:40:57 2017 [453496][1][FATAL] emails_email_templates_idb for emails_email_templates failed to load

Tue Jul 18 11:41:01 2017 [453849][1][FATAL] emails_email_templates_idb for emails_email_templates failed to load

Tue Jul 18 11:41:03 2017 [454289][1][FATAL] emails_email_templates_idb for emails_email_templates failed to load

I don’t know, then… I guess we’ll have to wait for that Issue to be fixed…

Hi
I do the same process and that Undefined thing is happening for me too. BUt I click on ok and the merge happens correctly (I did have to futz with the email templates after the upgrade but it is working). The merge even works in the subject line now.

That pop-up just informs you that the content of your email will be replaced (I think to fix it before you changed the permissions of some .js file to 777? Can’t seem to find that message anymore).

For the update, I deleted all the files from my install (except the config) and re-uploaded new files from the full 7.9.3 install zip, then ssh’d into my server and changed the permissions via the instructions in the install guide, logged in a did a quick repair and all is fine.

I’m still new to this so don’t have to worry about blasting any custom stuff yet (well, I do have to re-do a couple of drop-down customizations, re-enter the email passwords but that’s it so far)

Thanks Phil! I’m a bit hesitant to delete files to get this to work. I’m hopeful that the developers will fix it so that the upgrade path fixes it natively. I did find out the hard way that the php.ini file is changed in the upgrade. Next time I’ll make a backup of it.

crap - yeah, left the php.in file too

also, try setting the permissions of

/suite/cache/jsLanguage/en_us.js

to 777

That worked for me before

So, this is a portion of the log now:

Tue Jul 18 13:43:29 2017 [246458][1][FATAL] Failed to load relationship emails_email_templates while saving Emails
Tue Jul 18 13:43:31 2017 [246576][1][FATAL] emails_email_templates_idb for emails_email_templates failed to load

Tue Jul 18 13:43:31 2017 [246667][1][FATAL] emails_email_templates_idb for emails_email_templates failed to load

Tue Jul 18 14:44:24 2017 [658649][1][FATAL] emails_email_templates for emails_email_templates failed to load

Tue Jul 18 14:44:24 2017 [658649][1][FATAL] Failed to load relationship emails_email_templates while saving Emails
Tue Jul 18 14:44:25 2017 [658872][1][FATAL] emails_email_templates_idb for emails_email_templates failed to load

It would be great for this issue to be resolved in the next(hopefully soon) release.

Regards
John