This service has been created using Python 3.7 and smtplib library to enable you to engage customers across the channel email. The application was deployed in Heroku and actually is used in a large number of service cells of eva conversational flows.
- Python 3.7+
- Postman
- Cloud account (Azure, GCP, Heroku, etc)
- Run the file app.py
- Send this cURL with your fauvorite rest service client (I prefer Postman)
curl --location --request POST '[URL]' \
--header 'Content-Type: application/json' \
--data-raw '{
"plaintext":"[plaintext]",
"asunto":"[asunto]",
"sender":"[sender]"
}'
Where:
- [URL]: Refers to the service endpoint
- [asunto]: Refers to the subject of the message
- [plaintext]: Refers to the content of the message
- [sender]: Refers to the mail sender name
- To the main file you have to put main
- You have to indicate the first function that should run
- This function must be passed as a parameter self
- You have to extend the app's permissions
- Go t- o the Google Cloud Console
- Click the checkbox next to the role you want to grant access to.
- Click Show dashboard in the upper right corner to bring up the Permissions tab
- Click Add Member
- In the New Members field, type allUsers
- Select the Cloud Functions function> Cloud Functions Invoker from the Select a function drop-down menu
- Click Save
• Go to the https://myaccount.google.com/security • Go to item "Seguridad"
• And open the two steps verify
• Follow the steps wizard
• Add an app password
• Take note of the new app password
Note: this email and app password must be added to the line 33 in app.py fileNote: this email and app password must be added to the line 33 in app.py file
*Components are not supported