diff --git a/administrator/language/en-GB/plg_workflow_notification.ini b/administrator/language/en-GB/plg_workflow_notification.ini index 599caccdbdde9..f6ee4e71faeb7 100644 --- a/administrator/language/en-GB/plg_workflow_notification.ini +++ b/administrator/language/en-GB/plg_workflow_notification.ini @@ -11,6 +11,7 @@ PLG_WORKFLOW_NOTIFICATION_ADDTEXT_DESC="This text will be sent: Title [title], c PLG_WORKFLOW_NOTIFICATION_ADDTEXT_LABEL="Additional Message Text" PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_MSG="Title: %1$s. Transition \"%2$s\" performed by %3$s. New state: %4$s." PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_SUBJECT="The status of \"%s\" has been changed" +PLG_WORKFLOW_NOTIFICATION_NO_RECEIVER="No notifications sent as there are no users to send this message to." PLG_WORKFLOW_NOTIFICATION_NO_TITLE="Unknown title" PLG_WORKFLOW_NOTIFICATION_RECEIVERS_LABEL="Users" PLG_WORKFLOW_NOTIFICATION_SENDMAIL_LABEL="Send Notification" diff --git a/plugins/workflow/notification/notification.php b/plugins/workflow/notification/notification.php index 8b58e2be5c76a..b31c87463e4dd 100644 --- a/plugins/workflow/notification/notification.php +++ b/plugins/workflow/notification/notification.php @@ -160,6 +160,8 @@ public function onWorkflowAfterTransition(WorkflowTransitionEvent $event) // If there are no receivers, stop here if (empty($userIds)) { + $this->app->enqueueMessage(Text::_('PLG_WORKFLOW_NOTIFICATION_NO_RECEIVER'), 'error'); + return; }