verbb / workflow

A Craft CMS plugin to create a workflow for publishing entries.
Other
140 stars 27 forks source link

Error sending published author notification #183

Closed d-karstens closed 1 year ago

d-karstens commented 1 year ago

Describe the bug

Hi,

We're running into an issue where published author notifications are failing to send

Logs have the following error, and it looks like it's attempting to send another email to the editor account rather than the publisher accounts

2023-02-06 15:58:22 [INFO] Preparing editor notification.
2023-02-06 15:58:22 [INFO] Sent editor notification to research@mailinator.com
2023-02-06 15:58:22 [INFO] Preparing published author notification.
2023-02-06 15:58:22 [ERROR] Failed to send published author notification to research@mailinator.com - “Attempt to read property "subject" on null” /var/www/html/vendor/craftcms/cms/src/mail/Mailer.php:126
2023-02-06 15:58:22 [INFO] Request context:
$_GET = [
    'draftId' => '872'
]

$_POST = [
    'CRAFT_CSRF_TOKEN' => '••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    'title' => 'test'
    'elementId' => '3693'
    'siteId' => '1'
    'action' => 'elements/apply-draft'
    'redirect' => 'c58f23d96b26a7c2f45df49f9dc17a0f61029401b6791720993b9526650c9e6d{cpEditUrl}'
    'slug' => 'test'
    'authorId' => '23'
    'enabled' => '1'
    'notes' => ''
    'workflowNotes' => ''
    'submissionId' => '3694'
    'workflow-action' => 'approve-submission'
    'draftId' => '872'
    'draftName' => 'First draft'
]

Let me know if you need any more details Thanks!

Steps to reproduce

  1. Create a draft submission on an editor account
  2. Approve and publish from a publisher account

Craft CMS version

4.3.7.1

Plugin version

2.0.3

Multi-site?

No

Additional context

Unsure if it makes a difference, but we have two publisher accounts that should be getting a notification email. From what I can tell all other notifications are working fine

d-karstens commented 1 year ago

Ah nevermind about this, sorry! Had another look at the settings and realized publisher accounts shouldn't be getting the email anyway, so closing 👍

Unsure if the error means anything though

engram-design commented 1 year ago

That email error should be fixed for the next release. To get the fix early, change your verbb/workflow requirement in composer.json to:

"require": {
  "verbb/workflow": "dev-craft-4 as 2.0.3",
  "...": "..."
}

Then run composer update.