{"id":19772049,"url":"https://github.com/danieldacosta/lambda-email","last_synced_at":"2026-02-09T16:30:51.493Z","repository":{"id":112641593,"uuid":"279668441","full_name":"DanielDaCosta/lambda-email","owner":"DanielDaCosta","description":"Sending email through AWS lambda with Terraform using smtplib and SendGrid.","archived":false,"fork":false,"pushed_at":"2022-01-31T12:28:01.000Z","size":99,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-02T22:29:22.819Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanielDaCosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2020-07-14T18:53:20.000Z","updated_at":"2022-01-31T12:28:04.000Z","dependencies_parsed_at":"2023-06-02T06:15:23.440Z","dependency_job_id":null,"html_url":"https://github.com/DanielDaCosta/lambda-email","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DanielDaCosta/lambda-email","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Flambda-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Flambda-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Flambda-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Flambda-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielDaCosta","download_url":"https://codeload.github.com/DanielDaCosta/lambda-email/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Flambda-email/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29272696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T13:47:44.167Z","status":"ssl_error","status_checked_at":"2026-02-09T13:47:43.721Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-12T05:05:15.688Z","updated_at":"2026-02-09T16:30:51.478Z","avatar_url":"https://github.com/DanielDaCosta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lambda Email\n\nLambda that sends email to user, built using Terraform. It receives an array of dictionaries containing\nemail subject, content and the email to receive the message.\n\nLamba event input:\n\n```\n{\n    \"data\": {\n        [\n            {\n                'subject': 'Hello there from Python!',\n                'message': 'This message sent from lambda',\n                'to': 'teste@gmail.com'\n            },\n            {\n                'subject': 'Hello there from Python Again!',\n                'message': 'This message sent from lambda Again',\n                'to': 'unitys@gmail.com'\n            }\n        ]\n    }\n}\n```\n# Details\n\nThe repository already contains the required SendGrid 6.4.3 package installed inside the *package* folder.\nThis repo has both Sendgrid and stmlib implentations! Chose the one that you prefer.\n\n# Usage\n\nThis modules reads all its variables from Lambda Environment variables, as it can be seen in the file *config.py*.\n\nFor sendGrid credentials, you can create your free account in their website: https://sendgrid.com\n\n## Example of lambda call\n\nLambda *asynchronous invocation* is preferable:\n\n```python\nimport json\nimport boto3\nfrom config import MS_SMS\n\n# MS_SMS = \"name_of_function\"\n\nmessages_array = {\n    'data': [{\n        'subject': 'HELLO THERE!',\n        'message': 'NICE MEETING YOY',\n        'to': 'TEST_EMAIL@gmail.com'}]\n    }\n\ndef send_sms(messages_array):\n    \"\"\"Send sms\n    Args:\n        phone_number (string): the phone number that will receive the sms\n        body_message (string): the message\n    \"\"\"\n    client = boto3.client('lambda')\n    payload = {\n        \"data\": messages_array\n    }\n    client.invoke(\n        FunctionName=MS_SMS,\n        InvocationType='Event',\n        Payload=json.dumps(payload),\n        LogType='None'\n    )\n\n```\n\n## Calling module\n\n```terraform\n# Module \nmodule \"sms\" \n    source = \"git@github.com:DanielDaCosta/lambda-email.git\"\n\n    lambda_name             = var.lambda_sms\n    environment             = var.environment\n    name                    = var.name\n    region                  = var.region\n    EMAIL_ADDRESS           = var.EMAIL_ADDRESS\n    EMAIL_PASS              = var.EMAIL_PASS\n    SENDGRID_API_KEY        = var.SENDGRID_API_KEY\n}\n```\n\n# References \u0026 Acknowledgments\n- https://www.youtube.com/watch?v=JRCJ6RtE3xU\n- https://stackabuse.com/how-to-send-emails-with-gmail-using-python/\n- https://sendgrid.com/docs/for-developers/sending-email/v3-python-code-example/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldacosta%2Flambda-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieldacosta%2Flambda-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldacosta%2Flambda-email/lists"}