{"id":16164008,"url":"https://github.com/cyclenerd/google-cloud-appengine-mail-api","last_synced_at":"2025-03-18T22:31:25.246Z","repository":{"id":160505112,"uuid":"635379064","full_name":"Cyclenerd/google-cloud-appengine-mail-api","owner":"Cyclenerd","description":"📧 Create your own Mail API based on Google App Engine (GAE)","archived":false,"fork":false,"pushed_at":"2025-02-25T07:51:56.000Z","size":626,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T08:36:54.082Z","etag":null,"topics":["app-engine","gcloud","google-cloud","google-cloud-platform","mail-api","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cyclenerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Cyclenerd"}},"created_at":"2023-05-02T15:09:08.000Z","updated_at":"2025-02-25T07:51:53.000Z","dependencies_parsed_at":"2023-10-03T14:10:49.331Z","dependency_job_id":"b58f907f-62a3-44ac-b24d-f5fe62984be8","html_url":"https://github.com/Cyclenerd/google-cloud-appengine-mail-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyclenerd%2Fgoogle-cloud-appengine-mail-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyclenerd%2Fgoogle-cloud-appengine-mail-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyclenerd%2Fgoogle-cloud-appengine-mail-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyclenerd%2Fgoogle-cloud-appengine-mail-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cyclenerd","download_url":"https://codeload.github.com/Cyclenerd/google-cloud-appengine-mail-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955018,"owners_count":20374368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app-engine","gcloud","google-cloud","google-cloud-platform","mail-api","python","python3"],"created_at":"2024-10-10T02:44:58.573Z","updated_at":"2025-03-18T22:31:24.970Z","avatar_url":"https://github.com/Cyclenerd.png","language":"Python","funding_links":["https://github.com/sponsors/Cyclenerd"],"categories":[],"sub_categories":[],"readme":"# Google App Engine Mail API\n\n[![Badge: Google Cloud](https://img.shields.io/badge/Google%20Cloud-%234285F4.svg?logo=google-cloud\u0026logoColor=white)](https://github.com/Cyclenerd/google-cloud-appengine-mail-api#readme)\n[![Badge: Python](https://img.shields.io/badge/Python-3670A0?logo=python\u0026logoColor=ffdd54)](https://github.com/Cyclenerd/google-cloud-appengine-mail-api#readme)\n[![Badge: Terraform](https://img.shields.io/badge/Terraform-%235835CC.svg?logo=terraform\u0026logoColor=white)](https://github.com/Cyclenerd/google-cloud-appengine-mail-api#readme)\n[![Badge: CI](https://github.com/Cyclenerd/google-cloud-appengine-mail-api/actions/workflows/ci.yml/badge.svg)](https://github.com/Cyclenerd/google-cloud-appengine-mail-api/actions/workflows/ci.yml)\n[![Badge: LICENSE](https://img.shields.io/github/license/cyclenerd/google-cloud-appengine-mail-api)](https://github.com/Cyclenerd/google-cloud-appengine-mail-api/blob/master/LICENSE)\n\nCreate your own Mail API based on Google App Engine (GAE) with 99.95% uptime SLA.\n\nThis Mail API make integrating email into your existing applications easy with your own RESTful API.\nIt is developed in Python 3 and uses the Google App Engine API for legacy bundled services.\n\nMake API calls to emails:\n\n![Screenshot: Postman Mail API and Google Mail](./img/api-to-mail.png)\n\n\n## 🏃 Deploying\n\n1. Clone this repo\n    ```bash\n    git clone https://github.com/Cyclenerd/google-cloud-appengine-mail-api.git\n    cd google-cloud-appengine-mail-api\n1. Deploy app to App Engine\n    ```bash\n    gcloud config set project PROJECT_ID\n    gcloud app deploy\n    ```\n1. Create new Google Cloud Secret Manager secret\n    ```bash\n    gcloud auth application-default login\n    terraform init\n    terraform apply\n    ````\n1. Generate and store API password *(without newline)*\n    ```bash\n    openssl rand -hex 25 | tr -d \\\\n | gcloud secrets versions add \"api-password\" \\\n        --data-file=-\n    ```\n1. Access API password\n    ```bash\n    gcloud secrets versions access latest --secret=\"api-password\"\n    ```\n\nOptional:\nYou can set the mail sender (email address for From header) with the environment variable `SENDER` in [app.yaml](./app.yaml).\nDefault sender is `[PROJECT_ID] \u003cno-reply@[PROJECT_ID].appspotmail.com\u003e`.\n\n\n## 🔑 Authentication\n\nAuthentication to the Mail API is done by providing an Authorization header using HTTP Basic Auth; use `api` as the username and your secret API password as the password.\n\nHere is how you use basic HTTP auth with curl:\n\n```bash\ncurl --user 'api:YOUR_API_PASSWORD'\n```\n\n\u003e **Warning**\n\u003e Keep your API password secret! \n\n\n## 🆗 Status codes\n\nThe Mail API returns standard HTTP response codes.\n\n| Code | Description                                      |\n|------|--------------------------------------------------|\n| 201  | Everything worked as expected                    |\n| 401  | Unauthorized - No valid API password provided    |\n| 400  | Bad Request - Often missing a required parameter |\n\n\n## 📨 Sending\n\n```text\nPOST https://PROJECT_ID.REGION_ID.r.appspot.com/messages\n```\n\n| Parameter | Description |\n|-----------|-------------|\n| to        | Email address of the recipient(s). Example: \"Bob \u003cbob@host.com\u003e\". You can use commas to separate multiple recipients. |\n| subject   | Message subject | \n| text      | Body of the message. (text version) |\n\n\n### Example\n\nSending a plain text message:\n\n```bash\ncurl -s --user \"api:YOUR_API_PASSWORD\" \\\n    \"https://PROJECT_ID.REGION_ID.r.appspot.com/messages\"\n    -F \"to=test@nkn-it.de\" \\\n    -F \"subject=Test\" \\\n    -F \"text=Test\"\n```\n\nSample response:\n\nHTTP code: `201`\n\n```text\nSuccessfully sent mail to test@nkn-it.de.\n```\n\n👉 **[More examples (Go, PHP, Perl, Python, Ruby...)](./examples/)**\n\n\n## 🆘 Error codes\n\nThis is a list of possible return codes and messages from the `/messages` endpoint.\n\n| Code | Error message                        |\n|------|--------------------------------------|\n| 400  | `to` parameter is missing            |\n| 400  | `subject` parameter is missing       |\n| 400  | `text` parameter is missing          |\n| 401  | Forbidden (Unauthorized access)      |\n| 405  | Method not allowed (please use POST) |\n| 500  | Internal Server Error                |\n\n\n## 💡 Rate Limits\n\nThe default quota for email recipients is 100 per day.\nIf you need a higher mail quota, you can use SendGrid or Mailgun to send email.\n\n\n## 📚 Read more\n\n* [Sending mail with the Mail API](https://cloud.google.com/appengine/docs/standard/services/mail/sending-mail-with-mail-api)\n* [Flask app to access bundled Mail services API in Python 3](\nhttps://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/appengine/standard_python3/bundled-services/mail/flask)\n\n\n## ❤️ Contributing\n\nHave a patch that will benefit this project?\nAwesome! Follow these steps to have it accepted.\n\n1. Please read [how to contribute](CONTRIBUTING.md).\n1. Fork this Git repository and make your changes.\n1. Create a Pull Request.\n1. Incorporate review feedback to your changes.\n1. Accepted!\n\n\n## 📜 License\n\nAll files in this repository are under the [Apache License, Version 2.0](LICENSE) unless noted otherwise.\n\nPortions of this repository are modifications based on work created and shared by [Google](https://developers.google.com/readme/policies)\nand used according to terms described in the [Creative Commons 4.0 Attribution License](https://creativecommons.org/licenses/by/4.0/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyclenerd%2Fgoogle-cloud-appengine-mail-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyclenerd%2Fgoogle-cloud-appengine-mail-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyclenerd%2Fgoogle-cloud-appengine-mail-api/lists"}