-
Notifications
You must be signed in to change notification settings - Fork 0
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
Using Model.Summary in email templates does not show all steps. Just the first step. #94
Comments
Hey @bythewiseman, thanks for the report. The Will get this into the next sprint and find a solution. |
Which Workflow + CMS versions are you using? |
We are using U13 latest version and I upgraded Workflow via Nuget before testing to the latest version for U13. |
I haven't been able to reproduce this. In my tests latest v13 sends the following emails (this is a very simple site setup, with three groups each with a single user. Workflow was initiated, then approved by Group 1 and Group 2, before being rejected by Group 3): Workflow submitted for approval
Approved by Group 1, request sent to Group 2:
Approved by Group 2, email sent to Group 3:
Rejected by Group 3
Approval request for Group 3 after rejected task was resubmitted
|
I am going to write down the exact steps and messaging I used in order to make sure I have done something correct or not:
At this point I would expect an email from Workflows with the message "I do not wish this trail to be closed." within. But even after upgrading to the latest version of Workflows that came out on the 6th March, this emails that I receive only contain the first comment. The following is the code in the Reject Email: The result we get is this: Below is the raw Json from the code @Newtonsoft.Json.JsonConvert.SerializeObject(Model): which contains the message I entered at rejection ("comment": "I do not wish this trail to be closed.",), but is not displayed via Model.Summary as I would expect it. Anything I am doing wrong? |
That's all a bit odd - everything you're doing looks correct. Wondering now if it's somehow related to rejecting at the first stage, compared to my example where I rejected at stage 3. I'll take a look at a first-stage rejection and see what I can reproduce. |
We want all the steps in the current workflow to be present in the email that gets sent on all states. @Model.Summary I expect to do that, but doesn't.
Reproduction
Editing the Rejection notification email template; adding @Model.Summary; one would expect all the steps of the workflow messaging to be in the email. Or at least the last message applied to the workflow, in this case the Rejection Message.
However only the first Step appears.
The rejection message is in the Model. I know this by adding:
@Newtonsoft.Json.JsonConvert.SerializeObject(Model)
and seeing all the data contained therein. Things I have noted in this JSON output is that "currentStep" is always 0 and that tasks[x].instance object is always the a copy of the first task as the message is always the same. I don't know if that is by design.
And the Summary never contains tasks[x].comment only containing tasks[x].instance.comment again I don't know if that is by design.
The loop in your code (looking via dotPeek) feels like it doesn't work, looking for ApprovedByUserId but the JSON I can see shows approvedByIds, so maybe something is wrong there to stop the loop from going round each task?
Expected result
Upon using @Model.Summary I should see all the steps in descending order that has happen in the current workflow.
Actual result
Upon using @Model.Summary I only see the first step in the email.
This item has been added to our backlog AB#49684
The text was updated successfully, but these errors were encountered: