Send a Reply from Case Automation¶
Goal¶
Create a message in workflow logic and send it as a reply attached to the current case.
What You Will Learn¶
- create a message without sending it separately
- attach the message to the current case thread
- distinguish a case reply from an independent email
Difficulty and Estimated Time¶
- Difficulty: Advanced
- Estimated time: 20 minutes
Assumed Knowledge¶
You should be familiar with channel email configuration, message scripting, case threads, and postwork scripts.
Required Reading¶
Prerequisites¶
- a case-enabled channel with a configured sender address
- a related process with a case-handling task
- validated fields named
Reply/Recipient,Reply/Subject, andReply/Body
Steps¶
Add the following postwork script to the send action:
1 2 3 4 5 6 7 8 9 10 | |
Do not also call message.Send(). Case.Reply sends the message, attaches it to the case, and includes it in the case mail thread. Passing null uses the channel as the sender; false records the message as a reply rather than a forward.
How It Works¶
$Messages.New prepares a message instance. $Case.Reply sends that message through the case channel and creates the associated reply activity. The operation remains connected to the case instead of producing an unrelated email.
Verify the Result¶
Send a reply to a controlled test mailbox. Confirm that the message arrives once, appears in the case activity feed, and is included in the case message list.
Failure and Edge Cases¶
- Missing channel mail configuration prevents delivery.
- Retried postwork can send the same reply more than once.
- Invalid recipient data can cause asynchronous delivery failure after the workflow step completes.
Security and Portability Notes¶
- Validate recipient addresses and restrict who can trigger automated replies.
- Treat the subject and body as externally visible content; exclude secrets and internal-only notes.
- Record a sent marker or message identifier when duplicate delivery would be harmful.