Send an Email from Your Workflow
You can use the Email Workflow step to send an email to registered Harness User email addresses as part of your Workflow.
In this topic:
- Before You Begin
- Supported Platforms and Technologies
- Option: Use Your Own SMTP Server
- Step 1: Add the Email Step
- Step 2: Enter Addresses and Message
- Option: Use Variable Expressions in Body
- Configure As Code
Before You Begin
- You can only use email addresses that are registered to Harness User accounts. This helps to ensure secure communication from your Workflow. If the Email step uses an unregistered email address, it will not be sent to the unregistered email address.
- If the email is addressed to registered and unregistered addresses, only the registered addresses receive the email.
- The email that is received does not show the Harness User that executed the Workflow as the from or reply-to settings.
Supported Platforms and Technologies
Option: Use Your Own SMTP Server
By default, emails are sent using the built-in Harness default SMTP server.
To use your own SMTP server, follow the steps in Add SMTP Collaboration Provider.
Step 1: Add the Email Step
You can add the Email step to any section of a Workflow that allows steps.
- In your Harness Workflow, click Add Step.
- Click Email and then click Next.
- In Name, enter a name for the step.
Step 2: Enter Addresses and Message
- In To and CC, enter one or more email addresses of Harness Users. Email addresses are comma-separated.
- Provide a Subject and Body message.
The Body setting supports HTML. The Subject setting does not.
Option: Use Variable Expressions in Body
You can use Harness variables expressions in the Body of the message.
You can use built-in Harness expressions to display information about the deployment:
Testing email variables:
Which are displayed in the delivered message:
You can use Workflow variables also. You can use Service Config variables but the Email step must be in a Workflow phase where the Service is used, and not in a Pre-deployment section of the Workflow.
Configure As Code
To see how to configure the settings in this topic using YAML, configure the settings in the UI first, and then click the YAML editor button (</>).