The Email Marketing record is the actual scheduling of the group of emails using a defined template. An Email Marketing record is associated to the template and this is associated with the campaign. So for example, an Email Campaign will use a single Email Marketing record with a single Template. However a Newsletter Campaign (as it will more likely be a rescheduled campaign with repeat emails but at different times) you can create multiple differen t scheduled group of emails (each with their own template or a reselect the previous template) to send out and all the tracker info is recorded on the same campaign.
But it doesnāt work here. Using an existing Campaign which has already launched emails to a Target-List, lauching the wizard, on Marketing tab, when I change the Marketing Email Name, adjust schedule and Next to Send Email and Summary and then push Send Email at Scheduled Time, the emails, I can see the emails queued and, when I push Send Queued Campaign Emails, they are all Suppressed by Address or Domain if the Target-List was not changed.
The queue scheduler also doesnāt work, although cron is running and nightly email scheduler log has all the right entries, but thatās another story, I can live with the āSendā button.
Can someone help, please?
Generally speaking, this is a very good system, congratulations and thank you for letting me use it. Iāll try to find a way to introduce it to my customer base, but I must sort out a few details first.
Strange. But itās possible that something is not quite the way I was seeing it. Itās a complex part of SuiteCRM, and not always very well developed.
Are you a PHP developer? If so, I could point you to the relevant parts of the code, to help you explore a bit deeper.
I can help you fix the cron problems if you give more info. You can start with this, it should give you all the help you need:
Iām not a PHP developer but I can reasonably understand what the code is doing. Iām mostly a āCā developer although I use to think that languages are only a manual away; that is, if you are not too ambitious about the length and quality of the code you will produce. My usual environment is *nixes.
That said, my data user is āwwwā which is allowed_cron_user in config.php, my server OS is Freenas (FreeBSD), the webserver is running in a jail and my www crontab is:
I guess everything the last line is correct, isnāt it?
One thing I didnāt say is that, on the campaign status view, on the Message Sent/Attempted panel and Viewed Message panel, the Marketing ID column changes to the value of the last Marketing ID I issued, even on records already existing that had previous Marketing IDās, which shouldnāt happen. I hope my explanation was clear enough.
In order to run SuiteCRM Schedulers, edit your web server user's crontab file with this command:
**sudo crontab -e -u www**
... and add the following line to the crontab file:
*** * * * * cd /usr/local/www/apache24/data/crm; php -f cron.php > /dev/null 2>&1**
By the way, job log:
Run Nightly Process Bounced Campaign Emails done 2020-10-19 10:30 2020-10-19 10:30
Run Nightly Process Bounced Campaign Emails done 2020-10-19 10:25 2020-10-19 10:25
Run Nightly Process Bounced Campaign Emails done 2020-10-19 10:20 2020-10-19 10:20
Run Nightly Process Bounced Campaign Emails done 2020-10-19 10:15 2020-10-19 10:15
ā¦
This tells us that scheduler Nightly Process Bounced Campaign Emails is running, doesnāt it?
Oops, thatās not it, not bounced, and the timezone doesnāt seem correct, my bad:
Run Nightly Mass Email Campaigns done 2020-10-19 06:00 2020-10-19 06:00
Run Nightly Mass Email Campaigns done 2020-10-19 05:00 2020-10-19 05:00
Run Nightly Mass Email Campaigns done 2020-10-19 04:00 2020-10-19 04:00
Only the run interval was wrong, timezone is correct. But this probably explains why the queue was not processed at 09:00 as I wanted:
Run Nightly Mass Email Campaigns done 2020-10-19 13:00 2020-10-19 13:00
Run Nightly Mass Email Campaigns done 2020-10-19 06:00 2020-10-19 06:00
Run Nightly Mass Email Campaigns done 2020-10-19 05:00 2020-10-19 05:00
I donāt think this could affect the suppressions, my main problem, but if you donāt agree, I can load the email queue with another Marketing ID and test.
The timezone for that needs to be set in the php.ini of the CLI.
Check it with
php -i | grep timezone
Change it from the file given by
php -i | grep php.ini
Then restart web server.
I am unsure about the Email queuing part, so itās probably a good strategy to try and get this working accurately, then restart all your testing from scratch (new campaign).
Ahh right. So: your C skills are just fine. I also learned C/C++/C# and went into PHP without a second thought.
The Queuing takes place here, when you save a Campaign:
modules/Campaigns/QueueCampaign.php
I am not sure when it does when re-queuing - I would expect itās when you change the marketing record. From this point on, you can almost forget about the concept of campaign. Itās just a list of email addresses in emailman database table that will get selected and sent (after testing a bunch of conditions for dates, suppressions, etc).
Then the actual sending takes place here:
modules/EmailMan/EmailManDelivery.php
See suppressions-related code starting around line 187. For individual suppressions focus on the several calls to the set_as_sent function. These suppressions depend on the data in campaign_log database table.
In the meanwhile, doesnāt it ring a bell to you that existing emails, already sent, get their marketing ID changed?
If the comparison occurs after this, of course there must be coinciding emails, meaning, same adress because they were already sent, and same Marketing ID because it was just changed to the new one. Does this make any sense to you?
I wouldnāt be surprised if there was a bug (or bugs) lurking here.
I would also like to understand better this whole marketing_id thing. Iāve studied this Campaigns code a lot for the work I did on my PowerReplacer add-on, adding full Previews to Campaigns. I understand it a lot better than I did before, but still not completely. Itās very messy and opaque.
I would like to one day completely redesign this campaigns wizard. Everything needs to be so much clearer when youāre about to start hitting customers with tons of email. You really shouldnāt have to hesitate about whoās going to receive what.
I donāt really have a specific answer to your question (Iām hoping you can find it ). I havenāt seen any code writing new marketing_ids to emails tables; but if you can confirm itās happening we can always go find itā¦
Well, campaigns are one of the most useful functions of any crm, as Iām sure youāll agree. But, as you said, we must be certain of who receives what and we must be able to trust this. So, youāre right, it deserves a redesign.
Concerning the marketing_ids, as I said before, I can see on the campaign status window, on the message sent/attempted panel that the marketing_ids of existing mesages, whenever I issue an old campaign with a new value of marketing_id, change to this new value, that is, all the list has now the last marketing_id value. This also happens on the message viewed panel.
I would find strange that the values arenāt changed on the db table column, but only on the view.
So, Iām planning for later today to set up my terminal and prove that the field really changes, and post the results here for your information.
All right, I understand now what is happening, but not where in the code it is originated.
So, when I launch the wizard of an existing campaign and proceed up to the Marketing tab, I now have to edit the field Marketing Email Name to supposedly create a new marketing record.
But this is not happening. In fact, on the table email_marketing, instead of a new record being created, the existing one is being edited, changing the column ānameā the the text I had entered above. The Id field, which is the index, of course remains the same and so the Marketing record is effectively the same, with a changed ānameā.
Thatās why the messages are being suppressed, that is, same email address and same Marketing Id.
Furthermore, this explains why previously existing messages, on the campaign status panel, on the log of sent/attempted messages, the column Marketing Id changes to the new ānameā.
And also why on the Campaign Wizard, Send Email and Summary tab, Select Email Marketing Record drop down, thereās only one option to choose from, exactly the last one inserted.
Now, the question is: where in the code is the email_marketing table being edited instead of a new record created?
Thank you. It doesnāt work with the modified if elseif, just a blank window, but it does work with the original file, I can see the whole record with a small window on the bottom containing the remainder records. Didnāt try to save to check whether it goes to the wizard.
Anyway, I donāt need the editor window, I use Squirrel database manager for that.
Concerning the potential culprits, Iāve checked them briefly but I couldnāt find the place where the record is being edited instead of created. Iāll keep trying.