This function will send templated (by Jinja) email message with image attachment using AWS SES to the specified email address. May be useful for landing (marketing) static website which contains "Contact Us" form.
gcloud functions deploy <function-name> \
--runtime=python311 \
--region=europe-central2 \
--source=. \
--entry-point=hello_http \
--trigger-http \
--allow-unauthenticated
Edit Cloud Function using Google Cloud Console to set Runtime environment variables
(look required variables in .env.example
)
curl -X POST <FUNCTION_URL> \
-H "Content-Type: application/json" \
-d '{"your_name": "Denis"}'
- As endpoint can be called from any source it worth to add captcha integration to avoid bots spam you for your money, example of recaptcha implementation.