Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Approval Emails not sending

Status Resolved
Add-on / Version Publisher 2.8.2
Severity
EE Version 4.3.1

Martyn Tan

Jul 09, 2018

Description: Approval Emails when save as draft are not sending to the selected members. The website is using Sendgrid to send emails and emails are working from Expressionengine’s email utilities and Solspace’s freeform.


Detailed steps to reproduce the issue:
1.
2.
3.

#1

BoldMinded (Brian)

Hi, Martyn. I have another support ticket where a user is getting duplicate approval emails, and when I test locally I get a single approval email. I’m betting this is something wrong with your Publisher config, b/c emails do send. I realize this may sound harsh, but you have to provide information in order for me to debug this. You didn’t provide any steps to replicate and basically just said something doesn’t work, and I can’t work from that.

What have you done to debug the issue? What are your Publisher settings set to? Can you share screenshots? Does this happen in all channels or just a specific channel? What user are you logged in as? A Super Admin or another user set to a Publisher or Editor? Have you tried this on a different server? Do you see the approval in the Pending Approvals page in Publisher?

#2

Martyn Tan

Comment has been marked private.

#3

BoldMinded (Brian)

Have you tried to replicate this in a clean EE environment with no other add-ons installed?

Open up ext.publisher.php and go to line 287 and add this:

$logger = ee('publisher:FileLogger');
$logger->withBacktrace()->debug($lastSavedEntry);

then at line 274 and add this:

$logger = ee('publisher:FileLogger');
$logger->withBacktrace()->debug('booting');

Should look like this after they’re added:

$logger = ee('publisher:FileLogger');
$logger->withBacktrace()->debug('booting');

// Created as temporary variable when an entry is saved. When the next page in the CP
        // is loaded it will use that info, then erase it from SESSION, then we'll use it to
        // send out the email notifications. We have to wait until the next page load b/c its
        // the only way to ensure that the site_pages array is updated with the draft url.
        if ($lastSavedEntry = FlashBag::get('lastSavedEntry')) {
            if ($this->setting->get('draft_previews')) {
                ee()->load->model('publisher_draft_preview');
                $draftPreview = ee()->publisher_draft_preview->find($lastSavedEntry);
                $lastSavedEntry['previewUrl'] = isset($draftPreview->url) ? $draftPreview->url : null;
            }
            // Save reference so the tab file can display the preview modal.
            // Calling FlashBag::get() removes the item from the bag.
            $this->request->setLastSavedEntry($lastSavedEntry);

            $logger = ee('publisher:FileLogger');
            $logger->withBacktrace()->debug($lastSavedEntry);

            /** @var Notification $notification */
            $notification = ee(Notification::NAME);
            $notification
                ->setNotifyEmails($lastSavedEntry['notifyEmails'])
                ->setChannelId($lastSavedEntry['channelId'])
                ->setEntryId($lastSavedEntry['entryId'])
                ->sendAdminNotification();
        }

Then re-save an entry to trigger approvals and check user/cache/publisher/log.txt file to see what it output, and paste it here.

#4

BoldMinded (Brian)

Martyn, have you tried the logging output from my example?

#5

Martyn Tan

Hi Brian,

I’ve added in the code and used it on a clean install on the same server (EE + Publisher only). Am still unable to send any notifications on entry create/edit.

Here is the log output

[2018-07-26 05:44:07] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:12] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:13] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:16] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:16] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:16] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:16] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:22] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:22] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:22] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - Array [] [] [2018-07-26 05:44:28] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:30] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:30] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:32] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:33] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:33] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:35] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:41] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:42] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:43] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:47] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:48] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:48] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - Array [] [] [2018-07-26 05:44:49] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] [] [2018-07-26 05:44:49] generic.DEBUG: EE_Extensions->call_class() line: 221 - Publisher_ext->core_boot() line: 116 - booting [] []

#6

BoldMinded (Brian)

Can you provide CP and FTP login to the site with only Publisher installed. Also double check that the FTP login works and that it has permissions to edit files in the addons/publisher folder.

#7

BoldMinded (Brian)

You’re also a version behind on Publisher, so upgrade it too please.

#8

BoldMinded (Brian)

Comment has been marked private.

Login to reply