Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email notification subject submission status not updated correctly #202

Open
karthikkstar opened this issue Jan 31, 2024 · 7 comments
Open

Comments

@karthikkstar
Copy link

Describe the bug

Email notification subject submission status not updated correctly

SUBJECT: Your submission for "{{ submission.owner.title }}" has been {{ submission.status }}

The issue occurred only when the submission was approved or rejected the status was always "pending" on the following pages.
admin/workflow/submissions/edit/{submission_id}?site=australia ->On this page, when clicking "Save"
admin/workflow?site=australia&source=*&status=pending ->On this page, when clicking "set status"

image

Its working correctly on the entry page.
image

The email templates do not update the submission.status variable.

Thank you

Steps to reproduce

  1. Submit one workflow submission and approve or reject it from the submission listing or submission edit page. You will receive the wrong submission in the email notification.

Craft CMS version

4.6.1

Plugin version

2.0.8

Multi-site?

Yes

Additional context

No response

@engram-design
Copy link
Member

Is an error thrown when you try to set the status via the submission index? I will note that you're not able to approve your own submissions if you're both the editor and the user toggling the status. That would miss the point of a review process.

@karthikkstar
Copy link
Author

karthikkstar commented Feb 1, 2024

@engram-design Yes.On the submission index and submission edit page. We have different user groups for editors and publishers.
When you toggle the status:

  1. If the submission status is "pending," I will modify it to either approve or reject. The email associated with the submission.status variable corresponds to the "Pending" status.
  2. If the submission status is "reject," I will update it to approve. The email linked to the submission.status variable aligns with the "reject" status.

@engram-design
Copy link
Member

Thanks for the clarification, I can't seem to reproduce that I'm afraid. Any time I toggle the submission state (from the submission index, or when editing a submission) the status is correctly updated, and any associated emails are using the status that I've just updated to.

Just to be clear in your scenario - is the status in the control panel still staying as pending (in your first example)? And it's just the email subject that seems to be "behind"?

Just to confirm things are working correctly, can you confirm if a new row in your workflow_reviews database table is created when you change the status? It should reflect the status you're setting the submission to.

For example, here's the reviews for a submission of mine
image

The resulting email subject was Your submission for "Test Entry" has been approved on Default Site.

@karthikkstar
Copy link
Author

karthikkstar commented Feb 1, 2024

@engram-design Here is additional information for you to replicate.

Email template :

When a publisher approves or rejects an editor submission:

Subject: Your submission for "{{ submission.owner.title }}" has been {{ submission.status }} on the Website CMS.
Body: Hey {{ user.friendlyName }},

Your submission for {{ submission.owner.title }} has been {{ submission.status }} on the Website CMS.

Email screenshot
image

The submission's status is changed on the control panel during the updating, which is functioning well. Yes , it's just the email subject that seems to be "behind".

Yes. new row created on workflow_reviews table.
image

@engram-design
Copy link
Member

Oh, and the body content of the email would show the incorrect status too, right?

Your submission for test has been pending on the Website CMS.

Just in case it's a subject-specific issue, or any reference to status in the email.

@karthikkstar
Copy link
Author

Yes. Both subject and body content show incorrect status.

image

@karthikkstar
Copy link
Author

@engram-design another issue, I will adjust it to either approve or reject. The email linked to the {{submission.ownerCpUrl}} variable corresponds to a bad request.

image

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants