The Email pack provides the ability to send emails.
To build and run from the command line:
- Clone this repo
- Run
make build
- Run
FLYTE_API_URL=<URL> SMTPSERVER=<SERVER> ./flyte-email
- Fill in this command with the relevant API url and smtp server value.
To build and run from docker
- Run
make docker-build
- Run
docker run -e FLYTE_API_URL=<URL> -e SMTPSERVER=<SERVER> flyte-email
- All of these environment variables need to be set
This pack provides the 'SendEmail' command, and as its name suggests, simply sends an email.
This commands input requires the email from address, the email to address, the email subject, the email body and isHtmlEmail flag:
"input": {
"from": "[email protected]",
"to": "[email protected]",
"subject": "Open the pod bay doors, HAL",
"body": "...",
"isHtmlEmail": true
}
This command can either return an EmailSent
event meaning the email has successfully sent or an
SendEmailFailed
event, meaning there was a problem.
This is the success event, it contains the command name, sender, receiver, subject and email body. It returns them in the form:
"payload": {
"from": "[email protected]",
"to": "[email protected]",
"subject": "Open the pod bay doors, HAL",
"body": "...",
"isHtmlEmail": true
}
This contains the normal output fields plus the error if the command fails:
"payload": {
"from": "[email protected]",
"to": "[email protected]",
"subject": "Open the pod bay doors, HAL",
"body": "...",
"isHtmlEmail": true,
"error": "I'm sorry, Dave. I'm afraid I can't do that."
}