Using Expressions
You can use expressions in any email property in the Email executor. For example, you can base the condition on information in the event record, and include information about the pipeline in the email message.
You can use any functions that work for your use case, but here are some suggestions:
- pipeline functions
-
You can use the pipeline functions to provide pipeline information such as the pipeline name and ID.
For example, you can usepipeline:title()
andpipeline:id()
in the email message to indicate the pipeline that generated the event and email. You might use the following message when the email is configured to send after the Pipeline Finisher stops the pipeline:Heads up! ${pipeline:title()}, ${pipeline:id()}, has successfully completed.
- record functions
- You can use record functions to provide information from the event record.
For example, you should use
record:eventType()
in the condition if the pipeline routes multiple types of events to the Email executor and you want to send the email only upon receiving a particular event type. If you use the executor with the JDBC Query Consumer, you can use the following condition to send the email when a query successfully completes:${record:eventType() == 'jdbc-query-success'}
You might also use therecord:eventCreation()
function to include the time that the event occurred in the message. The creation time is returned in epoch time, so to create a readable timestamp, you can use the following expression:${time:millisecondsToDateTime(record:eventCreation() * 1000)}
And of course, you can use the
record:value
function to include information from the event record, such as the query that successfully completed. - file functions
- You can use file functions to provide information about a closed or written file.