You could use the email subject filter or email body filter. Create one or two of them, check the $JobState in it and customize the output. Refer to below doc.
------------------------------------------------------------------------------------------------------------------------
Create EmailBodyFilter.ps1/EmailSubjectFilter.ps1 in %CCP_HOME%Bin
- EmailSubjectFilter.ps1 has
2 parameters $JobId and $JobState. The output of the script will be the subject of the email. If the output is empty, the email will not be sent.
- param(
- [string] $JobId,
- [string] $JobState
- )
-
- if($JobId -eq 85)
- {
- "Job $JobId is
in $JobState state"
- EmailBodyFilter.ps1 has
4 parameters $Cluster, $JobId, $JobName and $JobState. The output of the script will be the content of the email. If the output is empty, the email will not be sent.
- param(
- [string] $Cluster,
- [string] $JobId,
- [string] $JobName,
- [string] $JobState
- )
-
- if($JobState -eq "Running")
- {
- "This
is a notification email from $Cluster.
- Job $JobName($JobId)
is in running state."
- Parameter
$Cluster is the name of the cluster.
- Parameter
$JobState could be one of “Running”, “Finished”, “Failed” or “Canceled”.