{"id":16135372,"url":"https://github.com/marktennyson/chalice-mail","last_synced_at":"2025-03-18T15:31:26.508Z","repository":{"id":62561693,"uuid":"357650138","full_name":"marktennyson/chalice-mail","owner":"marktennyson","description":"One of the most basic functions in a web application is the ability to send emails to your users fully serverlessly.","archived":false,"fork":false,"pushed_at":"2021-08-09T10:15:04.000Z","size":1198,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T10:33:57.704Z","etag":null,"topics":["aws","aws-chalice","aws-lambda","chalice-mail","mail","serverless","ses"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/chalice-mail/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marktennyson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-13T18:20:57.000Z","updated_at":"2021-12-22T17:11:27.000Z","dependencies_parsed_at":"2022-11-03T15:15:32.098Z","dependency_job_id":null,"html_url":"https://github.com/marktennyson/chalice-mail","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marktennyson%2Fchalice-mail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marktennyson%2Fchalice-mail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marktennyson%2Fchalice-mail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marktennyson%2Fchalice-mail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marktennyson","download_url":"https://codeload.github.com/marktennyson/chalice-mail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243936375,"owners_count":20371504,"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":["aws","aws-chalice","aws-lambda","chalice-mail","mail","serverless","ses"],"created_at":"2024-10-09T23:07:31.873Z","updated_at":"2025-03-18T15:31:26.069Z","avatar_url":"https://github.com/marktennyson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eOne of the most basic functions in a web application is the ability to send emails to your users fully serverlessly.\u003c/h1\u003e\n\n# Downloads\n[![Downloads](https://pepy.tech/badge/chalice-mail)](https://pepy.tech/project/chalice-mail) [![Downloads](https://pepy.tech/badge/chalice-mail/month)](https://pepy.tech/project/chalice-mail/month) [![Downloads](https://pepy.tech/badge/chalice-mail/week)](https://pepy.tech/project/chalice-mail/week)\n\u003cbr\u003e\n\n# Maintainers wanted\n\u003c!-- [Apply within](https://github.com/github-tools/github/issues/539) --\u003e\n\n# Chalice-Mail\n\n\u003c!-- [![Downloads per month](https://img.shields.io/npm/dm/github-api.svg?maxAge=2592000)][npm-package]\n[![Latest version](https://img.shields.io/npm/v/github-api.svg?maxAge=3600)][npm-package]\n[![Gitter](https://img.shields.io/gitter/room/github-tools/github.js.svg?maxAge=2592000)][gitter]\n[![Travis](https://img.shields.io/travis/github-tools/github.svg?maxAge=60)][travis-ci]\n[![Codecov](https://img.shields.io/codecov/c/github/github-tools/github.svg?maxAge=2592000)][codecov] --\u003e\n\nThe `Chalice-Mail` extension provides a simple interface to set up SMTP and AWS SES(Simple Email Service) with your Chalice application and to send messages from your views and scripts.\nsource code available at: \u003ca href=\"https://github.com/marktennyson/chalice-mail\"\u003eGithub Repo\u003c/a\u003e\n\n## Usage\n##### Using SMTP =\u003e TLS Encryption\n```python\nfrom chalice import Chalice\nfrom chalice_mail import Mail, Message\n\napp = Chalice(app_name='chalice-mail-test1')\nmail = Mail(app)\nmail.is_smtp = True\nmail.smtp_using_tls = True\nmail.username = \"someone@example.com\"\nmail.password = \"world's_top_secret_password\"\nmail.smtp_server = 'smtp.example.com'\nmail.smtp_port = 587\nmail.login()\n\n@app.route('/send-smtp-mail')\ndef send_smtp_mail():\n    msg = Message(mail)\n    msg.subject = \"this is the subject\"\n    msg.add_recipient(\"aniketsarkar@yahoo.com\")\n    msg.plain = \"This is the email body.\"\n    mail.send_email(msg)\n    return {'message':'email sended successfully'}\n\n```\n##### Using SMTP =\u003e SSL Encryption\n```python\nfrom chalice import Chalice\nfrom chalice_mail import Mail, Message\n\napp = Chalice(app_name='chalice-mail-test1')\nmail = Mail(app)\nmail.is_smtp = True\nmail.smtp_using_ssl = True\nmail.username = \"someone@example.com\"\nmail.password = \"world's_top_secret_password\"\nmail.smtp_server = 'smtp.example.com'\nmail.smtp_port = 465\nmail.login()\n\n@app.route('/send-smtp-mail')\ndef send_smtp_mail():\n    msg = Message(mail)\n    msg.subject = \"this is the subject\"\n    msg.add_recipient(\"aniketsarkar@yahoo.com\")\n    msg.plain = \"This is the email body.\"\n    mail.send_email(msg)\n    return {'message':'email sended successfully'}\n\n```\n##### Using SES(Simple Email Service)\n```python\nfrom chalice import Chalice\nfrom chalice_mail import Mail, Message\n\napp = Chalice(app_name='chalice-mail-test1')\nmail = Mail(app)\nmail.username = \"someone@example.com\"\nmail.aws_region = \"ap-south-1\"\n\"\"\"\nplease provide the value of 'mail.aws_secret_id' \nand 'mail.aws_secret_key' if you want to set the AWS \nIam user manually.\n\"\"\"\nmail.login()\n\n@app.route('/send-smtp-mail')\ndef send_smtp_mail():\n    msg = Message(mail)\n    msg.subject = \"this is the subject\"\n    msg.add_recipient(\"aniketsarkar@yahoo.com\")\n    msg.plain = \"This is the email body.\"\n    mail.send_email(msg)\n    return {'message':'email sended successfully'}\n\n```\n##### Using SMTP =\u003e Email with HTML\n```python\nfrom chalice import Chalice\nfrom chalice_mail import Mail, Message\n\napp = Chalice(app_name='chalice-mail-test1')\nmail = Mail(app)\nmail.is_smtp = True\nmail.smtp_using_tls = True\nmail.username = \"someone@example.com\"\nmail.password = \"world's_top_secret_password\"\nmail.smtp_server = 'smtp.example.com'\nmail.smtp_port = 587\nmail.login()\n\n@app.route('/send-smtp-mail')\ndef send_smtp_mail():\n    msg = Message(mail)\n    msg.subject = \"this is the subject\"\n    msg.add_recipient(\"aniketsarkar@yahoo.com\")\n    \"\"\" \n    Simply pass the html value to the html variable of Message instance.\n    \"\"\"\n    msg.html = \"\u003ch1\u003eThis is the email body.\u003c/h1\u003e\"\n    mail.send_email(msg)\n    return {'message':'email sended successfully'}\n\n```\n##### Using SMTP =\u003e Email with HTML rendering\n```python\nfrom chalice import Chalice\nfrom chalice_mail import Mail, Message\nfrom pathlib import Path\nfrom os import path\n\napp = Chalice(app_name='chalice-mail-test1')\n_baseDir = Path(path.realpath(__file__)).parent\nmail = Mail(app)\nmail.is_smtp = True\nmail.smtp_using_tls = True\nmail.username = \"someone@example.com\"\nmail.password = \"world's_top_secret_password\"\nmail.smtp_server = 'smtp.example.com'\nmail.smtp_port = 587\nmail.template_dir = _baseDir/'templates' # required if using template rendering.\nmail.login()\n\n@app.route('/send-smtp-mail')\ndef send_smtp_mail():\n    msg = Message(mail)\n    msg.subject = \"this is the subject\"\n    msg.add_recipient(\"aniketsarkar@yahoo.com\")\n    context={}\n    \"\"\"\n    This package comes with the jinja2 based template rendering system.\n    Simpley use the 'render_template()' function to rend the html file.\n        'render_template()' functions takes the html file name as arguments \n    and the context as well as.\n    \"\"\"\n    msg.html = mail.render_template('index.html', context)\n    mail.send_email(msg)\n    return {'message':'email sended successfully'}\n\n```\n##### Using SMTP =\u003e Email with attachments\n```python\nfrom chalice import Chalice\nfrom chalice_mail import Mail, Message\nfrom pathlib import Path\nfrom os import path\n\napp = Chalice(app_name='chalice-mail-test1')\n_baseDir = Path(path.realpath(__file__)).parent\nmail = Mail(app)\nmail.is_smtp = True\nmail.smtp_using_tls = True\nmail.username = \"someone@example.com\"\nmail.password = \"world's_top_secret_password\"\nmail.smtp_server = 'smtp.example.com'\nmail.smtp_port = 587\nmail.attachment_dir = _baseDir/'attachments' # required if using attachments.\nmail.login()\n\n@app.route('/send-smtp-mail')\ndef send_smtp_mail():\n    msg = Message(mail)\n    msg.subject = \"this is the subject\"\n    msg.add_recipient(\"aniketsarkar@yahoo.com\")\n    msg.plain = \"This is the email body.\"\n    \"\"\"\n    Use the 'add_attachments()' function to add the attachments \n    with the message instance. Don't forget to put the attachments \n    on the attachments folder.\n        'add_attachments()' function basically takes list or str data \n    type as argument. If you want to add only one attachment just pass \n    the attachment name. If you want to add more than one attachments use a list.\n    \"\"\"\n    msg.add_attachments(['python.png', 'README.rst'])\n    mail.send_email(msg)\n    return {'message':'email sended successfully'}\n\n```\n\n## Installation\n`chalice-mail` is available from `pypi`.\n#### install using pip\n```shell\npip install chalice-mail\n```\n#### install from source code\n```shell\ngit clone https://github.com/marktennyson/chalice-mail \u0026\u0026 cd chalice-mail\npython setup.py install --user\n```\n\n## Compatibility\n`chalice-mail` is compatiable with python3.6 and higher versions.\nNot compatiable for Python version 2.\n\n\n## Contributing\n\nWe welcome contributions of all types!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarktennyson%2Fchalice-mail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarktennyson%2Fchalice-mail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarktennyson%2Fchalice-mail/lists"}