Allow Content Moderation to send email when state doesn't change but a transition exists

Created on 4 February 2022, almost 3 years ago
Updated 10 January 2024, 10 months ago

Problem/Motivation

When using on a client project the request was made to receive emails when content was marked Needs Review or Published. We landed on workbench_email as the solution since we are using core Content Moderation. Now that this is in use we are noticing that when the state is old state is Published and the new state is Published emails are not being sent.

Steps to reproduce

1. Setup a Transition Published to Published or any other old to new that is the same.
2. Enable an Email Template for that transition.
3. Confirm that the email is not sent.

Proposed resolution

In _workbench_email_content_moderation_event_shim() there is a check $original_state !== $new_state this should be removed to allow anyone defined transitions to send email.

Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇺🇸United States seantwalsh Eatontown, NJ

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Is it necessary to make it configurable? Emails will only fire if they are assigned to specific workflows. If you don't want Publish >> Publish to send an email, then don't assign one to it. Unless I'm missing something, it seems like this would be an okay feature to add to the module without also needing to add options/settings to the config.

  • Is it necessary to make it configurable? Emails will only fire if they are assigned to specific workflows. If you don't want Publish >> Publish to send an email, then don't assign one to it. Unless I'm missing something, it seems like this would be an okay feature to add to the module without also needing to add options/settings to the config.

  • 🇩🇪Germany anruether Bonn

    @hannakras I agree with you and also keep my transitions tidy in the sense that I do not allow multiple "From" states in the same transition. In that case you are right.

    But it is possible to configure multiple from states in one transition so that your assumption is not always right.

  • First commit to issue fork.
Production build 0.71.5 2024