Cloud Functions Action and Sequence
IBM Cloud Functions are based on OpenWhisk. You can create individual actions and chain them into a sequence. This allows to better structure and reuse code. For the purpose of sending out alerts, a sequence of actions is deployed. The first action receives the alert payload and decrypts it. The payload is encrypted because it may contain sensitive information.
Send email via SMTP
The decrypted alert information is passed on to the next action in the sequence. The newly added sample (re)uses a Python function to compose the email body from the alert information and to set up a configuration object for the next action. Finally, a new action written in Node.js utilizing the Nodemailer module sends out the email via SMTP server.
You can deploy the new IBM Cloud Functions sequence using a manifest file, thereafter create a test alert to see whether it works end-to-end.
If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or LinkedIn.