Campaigns not sending emails

Campaigns not working, meaning its not sending emails with proper trigger.



Test email works but not the campaign emails.



Cron job error email from bluehost shared hosting: (different time periods per error)



mount: /var/fake/myhomeph/var/lib/mysql not mounted already, or bad option



cp: cannot create symbolic link `/var/fake/myhomeph/etc/./localtime’: File exists



mount: warning: /var/fake/myhomeph/ramdisk/php seems to be mounted read-write.



I used php-cli At te start of the cron job command as well as and env prod at the end.



Any thoughts?


Campaigns not working, meaning its not sending emails with proper trigger.

Test email works but not the campaign emails.

Cron job error email from bluehost shared hosting: (different time periods per error)

mount: /var/fake/myhomeph/var/lib/mysql not mounted already, or bad option

cp: cannot create symbolic link `/var/fake/myhomeph/etc/./localtime’: File exists

mount: warning: /var/fake/myhomeph/ramdisk/php seems to be mounted read-write.

I used php-cli At te start of the cron job command as well as and env prod at the end.

Any thoughts?

Im getting the same issues with the cron jobs setup with the php-cli prefix as well. The one off emails are working just fine. mautic:campaign:trigger was executing the job, but it skipped the email send entirely, but executed a trigger that should of fired after the email was opened.

Thanks in advance for any insight.

What version of Mautic do you have currently installed? I had the exact same problem when I updated to version 2.1 on the 12th of August. I had a backup so I rolled back to version 2.0.1 and everything worked fine again… So it might be a bug in the 2.1 version that is responsible.

Hey Mautic family :slight_smile:

I have same problem

  • email is sent if set-up as ACTION in the FORM
  • email is not sent if its part of the CAMPAIGN (and it doesnt matter if CONTACT SOURCE is CONTACT SEGMENT or CAMPAIGN FORM)

Anybody same experience? Is there any progress about all questions above?

Thanks, Jakub

Hey i have the same problem as well.
Mautic 2.7.1 Test emails and email from form actions are working fine. But Campaign email are not sending.

Someone any ideas??
Contacts are getting in the campaign they just dont get the email

I’m on Mautic 2.5.1 and have the same issue. When running the campaign trigger from the command line, I get the following error:

[DoctrineDBALExceptionSyntaxErrorException]
An exception occurred while executing ‘SELECT c.*, l.lead_id, l.is_primary FROM ma_companies c INNER JOIN ma_companies_leads l ON l.
company_id = c.id WHERE (l.manually_removed = 0) AND (l.lead_id IN ()) ORDER BY l.date_added, l.company_id DESC’:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to y
our MySQL server version for the right syntax to use near ‘)) ORDER BY l.date_added, l.company_id DESC’ at line 1

[DoctrineDBALDriverPDOException]
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to y
our MySQL server version for the right syntax to use near ‘)) ORDER BY l.date_added, l.company_id DESC’ at line 1

[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to y
our MySQL server version for the right syntax to use near ‘)) ORDER BY l.date_added, l.company_id DESC’ at line 1

1 Like

Hey everyone,

I fixed my case, so i am sharing it just in case i help others.
So, in my case the issue was that cron jobs were not executing because i have been using old version of php in cron jobs. so what i did was to add this in my cron jobs:

/usr/local/php70/bin/

so a complete cron job command that works for me is

/usr/local/php70/bin/php /home/mydomain/public_html/mautic/app/console mautic:campaigns:rebuild

I hope i help others.
Just a side note is that i use mautic on a shared server.

1 Like

@auto Do you remember the specific errors generated before you made this change? I’m just curious if the errors are similar to what I posted above.

Thanks!

Ray

@gigcity My apologies but no i do not remember the error.
Have you resolved your problems?

I have not. Still working on it.

@gigcity @auto @Carlyn @scottmerselis

SELECT c.*, l.lead_id, l.is_primary FROM ma_companies c INNER JOIN ma_companies_leads l ON l.
company_id = c.id WHERE (l.manually_removed = 0) AND (l.lead_id IN (CONSTANT IS MISSING)) ORDER BY l.date_added, l.company_id DESC

I started using Mautic last week so pardon my ignorance, what are the requirement between a company and contacts in relation to campaigns?

This query seems to imply that a company needs to have a contact (aka; lead) attached or the campaign that was constructed included a relationship between a contact and company when non existed.

Do you have a company attached to the contact used in the campaign?

I do and the campaign ran without error. As you can see in the SQL at the bottom of this post, identified at contact #8 and #49. @gigcity SQL statement doesn’t have any values.

The exact moment an error is generated where I typed CONSTANT IS MISSING because the IN clause is missing a parameter.

Could have a couple issues here, but please post the following:

  • OS: the distribution and version. Have you applied all the latest patches? # cat /proc/version

  • SQL: name of database server, version, and have you applied the latest patches? # mysql -V

  • PHP: run # php -v and # php -m

That query could contain a NULL character as well, but I don’t see the point in that, but, maybe your database isn’t handling NULLs properly.

SELECT c.*, l.lead_id, l.is_primary FROM mautic_companies c INNER JOIN mautic_companies_leads l ON l.company_id = c.id WHERE (l.manually_removed = 0) AND (l.lead_id IN (8, 49)) ORDER BY l.date_added, l.company_id DESC;

@redneckbob
OS: Linux version 3.13.0-95-generic (buildd@lgw01-58) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) )
SQL: Ver 14.14 Distrib 5.6.32, for linux-glibc2.5
PHP: PHP 5.6.25 with Zend OPcache v7.0.6-dev
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
json
ldap
libxml
mbstring
mcrypt
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tidy
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

I am having a similar problem as described. I set up a campaign which is supposed to send out an email when someone subscribes. I tested it with 2 different email addresses and in the campaign builder it shows that I have been added and says the emails have been sent, but I have not actually received the emails at either one of my email addresses.

I am computer literate but NOT technical and don’t know the first thing about coding, so I need someone to explain to me in laymen’s terms what I need to do to fix this. Thanks!

When running this command from SSH:
php app/console doctrine:migration:migrate

I get the following errors:

Migration 20160606000000 failed during Execution. Error An exception occurred while executing ‘CREATE INDEX ma_campaign_leads ON ma_campaign_leads (campaign_id, manually_removed, date_added, lead_id)’:

SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name ‘ma_campaign_leads’

@redneckbob it seems that I have 60 or so doctrine:migration things to process. These apparently have not run via the normal upgrade process. In that I’m running a Bitnami instance and have done simple updates using the web UI, I wouldn’t be surprised if many of the other campaign related issues being reported are related to this.

@LilyAF – can you try running the same command? I’m curious if you get the same result.

thoughts?

@gigcity, Awesome, thanks. I don’t see any reported issues with the IN clause in mysql 5.6.32 and I’m unclear if NULL is acceptable or not in this context. I suspect there is an issue in the Mautic code that doesn’t include lead.id (aka; Contact id).

If everyone else with this exact SQL error is running Ubuntu 14.04.3 with MysSQL 5.6.32 on PHP 5.6.25 then we’ll dig into the platform, otherwise, I’m going to turn back to Mautic.

I’m on a fresh install of 2.7.1 and I’m able to get send an email via Campaign.

Assumptions:

  • You’ve already added an email, type Template, to Mautic.
  • You’ve setup e-mail in Mautic, tested it, and it works.

To do:

  1. Create a Contact
  2. Create a Segment
  3. Create a Campaign

  1. Contact -> New -> only add First Name, Last Name and Email redneckbob@gmail.com. Press Save & Close

  2. Segments -> New -> enter Name (Test Email To Me), Description, Alias and Filter is “Email equals redneckbob@gmail.com”. Press Save & Close. I sit and reload the Contact Segments page until the cron job finishes and the Contacts update. Image: http://dev-null.com/2017-04-08_19-02-07.jpg.

  3. Campaign -> New -> enter Name, Description, select my test category, Publish is Yes and set to yesterday, then launch Campaign Builder.

In Campaign Builder:

  • Contact Sources: Contact Segments
  • Contact Segments: select Test Email To Me (see step #2 above) and press Add.
  • Click the + on the bottom of the Test Email To Me box and take the blue option Select.
  • Select Action -> Send Email
  • on Send Email page enter name, execute immediately, email type transactional, and select the email to send (I already added earlier in the week). Press Add when done. Press Close Builder. Press Save and Close.

Now I reload the Campaign’s page until the Actions and Contacts are updated at which point cron sends the email and it shows up in my inbox.

@redneckbob – Thanks. About to fire this off. BTW - I need to clarify. My issue is with a 4-week campaign. Week 1 fires but Week 2 never triggers. If yiou don’t mind, I’ll set this Campaign to fire a 2nd email in about 15 minutes. Stand-by.

@redneckbob — apologies for the delay. I’m trying to clear a couple of SQL errors and hosed my box a bit. I’ll let you know when I can pull the trigger on that campaign. =)

@redneckbob — ok. Finished SQL updates and things are working. I’ll post those edits to the other thread.

You should have an email from my system. Once you read that email, you should trigger the 2nd email in the campaign. That’s where I’ve been seeing problems.

Hi,
I am not able to send emails through a campaign either.
I have successfully sent a test email.
There are no errors in the error log.
CRON jobs are working.
I have re-added contacts to their segments and made a new identical segment.
What else should I do?