This GitHub repository is being created to help you understand how to easily deal with emails when working on serverless/microservice architectures on Alibaba Cloud Function Compute.
We make use of nodejs8 runtime and the official SendinBlue API wrapper
To orchestrate all, we leverage
fun, an amazing tool made by Alibaba Cloud that helps you form serverless resources by filling-out a
yml config file.
- Get your Alibaba Cloud credentials from the web console, you need your Account ID and a API/SECRET keypair.
- Fill the
.envfile with said credentials.
- Set your valid email address and SendinBlue token in the
npm installinside the
fun deployand wait for the script to finish.
Once everything is uploaded, go to your Alibaba Cloud console and navigate to the Function Compute Service you just created, in this case
mailerfunctions Service under Sydney Region, with the
mailer function inside it.
Because we are testing the function, we will need to create an event with the following body:
"email": "[email protected]",
"message": "Hello from Function Compute"
If everything went well, you should get a message in your email.