Configure SMTP and Email Sender
Info
If Edge Xpert is running in secure mode, you will need to replace localhost in the URL with the IP address for the service. See CLI Service Ports for details.
Edge Xpert uses Gmail SMTP by default.
If you wish to use another SMTP Server, update the SMTP settings on Consul.
http://localhost:8500/ui/dc1/kv/edgex/core/2.0/support-notifications/SMTP
edgexpert restart support-notifications
Store username/password as insecure secrets
- Start Edge Xpert Notifications service with Consul
edgexpert up consul support-notifications
- Open a browser and go to Consul's GUI on
http://localhost:8500/ui
- Navigate to the Writeable.InsecureSecrets.SMTP.Secrets page for Alerts and Notifications. This can be found at
http://localhost:8500/ui/dc1/kv/edgex/core/2.0/support-notifications/Writable/InsecureSecrets/SMTP/Secrets/
- Set an email account (sender) to the
username
and the password (or the app password) to thepassword
Store username/password as secrets
- Start Edge Xpert Notifications service with security services
edgexpert up --secret support-notifications
- Add secrets using REST, replace {EmailAccount} and {AppPassword} with your email and app password
Info
If Edge Xpert is running in secure mode, you will need to replace localhost in the URL with the IP address for the service. See [CLI Service Ports][14] for details.
curl -X POST \
http://localhost:59860/api/v2/secret \
-H 'Content-Type: application/json' \
-d '{
"apiVersion" : "v2",
"path" : "smtp",
"secretData" : [
{
"key" : "username",
"value" : "{EmailAccount}"
},
{
"key": "password",
"value": "{AppPassword}"
}
]
}'
{"apiVersion":"v2","statusCode":201}