Comala Document Management | Custom email message after rejection
Asked by Daniela Pbrand:

Hi,

I want to configure Comala Document Management so that the document creator receives a custom email after the rejection. I've tried a number of things (like permission settings or stating the actual email address), but there is an error in my script, and it doesn't work. No email. Can anyone help with this?

Here's my script:

{  
"name": "Approval Workflow KMS with Message - Draft",  
"id": "custom",  
"description": "A simple workflow for Draft/Review/Approved/Rejected content in the draft workspace",  
"HTMLdescription": "A simple workflow for Draft/Review/Approved/Rejected content. The initial state of the page is Draft. If the document is reviewed and approved, it transitions to the Approved state. If it's rejected, it goes to the Rejected state.",  
"states": \[  
{  
"name": "Draft",  
"transitions": {  
"select": \[  
"Review"  
\]  
},  
"colour": "#FFAB00",  
"approvals": \[\]  
},  
{  
"name": "Review",  
"colour": "#0052CC",  
"taskable": true,  
"transitions": {  
"approved": "Approved",  
"rejected": "Rejected"  
},  
"approvals": \[  
{  
"name": "Approval",  
"preassignedUsers": {  
"items": \[  
"712020:7477d2ed-2672-4b5b-90df-25b2e82eb7d6"  
\]  
},  
"minimum": 1  
}  
\]  
},  
{  
"name": "Approved",  
"transitions": {  
"Published": "Published"  
},  
"colour": "#4a6785",  
"final": false,  
"versionsCompleted": false  
},  
{  
"name": "Rejected",  
"transitions": {  
"Review": "Review"  
},  
"colour": "#FF5630",  
"approvals": \[\],  
"triggers": \[  
{  
"event": "on-reject",  
"actions": \[  
{  
"action": "send-email",  
"recipients": \[  
"@creator"  
\],  
"notification": {  
"subject": "${content.title} has been rejected",  
"title": "${content.title} has been rejected by the approver",  
"body": "Hello, ${content.link} in the ${content.space} space has been rejected and needs to be reviewed. Please resolve any comments added by the approver and re-submit the document."  
}  
},  
{  
"action": "set-message",  
"type": "info",  
"title": "Rejected",  
"body": "The page has been rejected",  
"tags": "state",  
"mode": "autoClose"  
}  
\]  
}  
\]  
}  
\]  
}


Answers:
author: Sandeep Saluru _Appfire_
body: Hi [@Daniela Pbrand](/t5/user/viewprofilepage/user-id/5326257)

Please find the below workflow schema which is working, the email is triggered to the creator of the page when the page is rejected.

```
{
"name": "Approval Workflow KMS with Message - Final",
"id": "custom",
"description": "A simple workflow for Draft/Review/Approved/Rejected content in the draft workspace",
"HTMLdescription": "A simple workflow for Draft/Review/Approved/Rejected content. The initial state of the page is Draft. If the document is reviewed and approved, it transitions to the Approved state. If it's rejected, it goes to the Rejected state.",
"states": [
{
"name": "Draft",
"transitions": {
"select": [
"Review"
]
},
"colour": "#ffab00"
},
{
"name": "Review",
"colour": "#0052CC",
"taskable": true,
"transitions": {
"approved": "Approved",
"rejected": "Rejected"
},
"approvals": [
{
"name": "Approval",
"preassignedUsers": {
"items": [
"712020:7477d2ed-2672-4b5b-90df-25b2e82eb7d6"
]
},
"minimum": 1
}
]
},
{
"name": "Approved",
"transitions": {
"select": [
"Published"
]
},
"colour": "#ffab00"
},
{
"name": "Rejected",
"transitions": {
"updated": "Review"
},
"colour": "#FF5630"
},
{
"name": "Published",
"colour": "#14892c",
"taskable": true,
"transitions": {
"updated": "Review"
},
"final": true
}
],
"triggers": [
{
"event": "on-reject",
"actions": [
{
"action": "send-email",
"recipients": [
"@creator"
],
"notification": {
"subject": "${content.title} has been rejected",
"title": "${content.title} has been rejected by the approver",
"body": "Hello, ${content.link} in the ${content.space} space has been rejected and needs to be reviewed. Please resolve any comments added by the approver and re-submit the document."
}
},
{
"action": "set-message",
"type": "info",
"title": "Rejected",
"body": "The page has been rejected",
"tags": "state",
"mode": "autoClose"
}
]
}
]
}
```

The reason it wasn't triggered for you is the trigger is placed inside the Rejected state. It should be placed separately, outside the state.

Regards,

Sandeep

comments: author: Daniela Pbrand
body: Works like a charm, thanks so much!


author: Sandeep Saluru _Appfire_
body: Hi [@Daniela Pbrand](https://community.atlassian.com/t5/user/viewprofilepage/user-id/5326257)

We are from the Appfire support team and would like to inform you that we have created a support request <https://appfire.atlassian.net/servicedesk/customer/portal/11/SUPPORT-125618> on your behalf in our portal. Request you to sign up into the portal and let us know the username so that we can mark you as the reporter to be able to access the ticket.

Please find the link <https://appfire.atlassian.net/servicedesk/customer/portal/11> to sign up for the portal.

Regards,

Sandeep

comments: author: Daniela Pbrand
body: Hi Sandeep!

Thanks for raising a ticket for me. However, I don't have permission to view this request. I've signed up for the portal but can't access the ticket. Can you update it?


author: Sandeep Saluru _Appfire_
body: Hi Daniela,

Thank You for the response. We have added you as the reporter. If you are unable to access the ticket, please confirm the username/email ID that you have used to sign up for the portal.

Regards,

Sandeep


Tags: cloud

confluence-cloud