{"id":16420034,"url":"https://github.com/ramanaditya/email-service","last_synced_at":"2025-03-23T07:31:55.153Z","repository":{"id":46600038,"uuid":"325432295","full_name":"ramanaditya/email-service","owner":"ramanaditya","description":"Python package to quickly integrate different email services with your Application with just 3 lines of code.","archived":false,"fork":false,"pushed_at":"2023-07-01T09:36:56.000Z","size":69,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T18:45:15.952Z","etag":null,"topics":["amazon-ses","email","email-client","hacktoberfest","mailgun","project","python","sendgrid"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/email-service/","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/ramanaditya.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2020-12-30T02:13:57.000Z","updated_at":"2025-01-06T22:19:43.000Z","dependencies_parsed_at":"2024-10-28T15:28:36.571Z","dependency_job_id":"9fca5652-42da-47fb-8443-715b73225af6","html_url":"https://github.com/ramanaditya/email-service","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"ed1f480b3df0dc11dd2825b13703d915334dbee0"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramanaditya%2Femail-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramanaditya%2Femail-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramanaditya%2Femail-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramanaditya%2Femail-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramanaditya","download_url":"https://codeload.github.com/ramanaditya/email-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245071886,"owners_count":20556352,"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":["amazon-ses","email","email-client","hacktoberfest","mailgun","project","python","sendgrid"],"created_at":"2024-10-11T07:26:40.170Z","updated_at":"2025-03-23T07:31:54.786Z","avatar_url":"https://github.com/ramanaditya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"###############\nEmail Service\n###############\n\nPython package to quickly integrate different email services with your Application with just 3 lines of code.\n\n.. image:: https://img.shields.io/pypi/v/email-service.svg?color=2897A6\n    :target: https://pypi.org/project/email-service/\n    :alt: pypi\n.. image:: https://img.shields.io/pypi/pyversions/email-service.svg\n    :target: https://pypi.org/project/email-service/\n    :alt: python\n.. image:: https://img.shields.io/badge/license-MIT-red.svg?style=flat-square\n    :target: https://github.com/ramanaditya/email-service\n    :alt: license\n.. image:: https://img.shields.io/github/v/release/ramanaditya/email-service.svg\n    :target: https://github.com/ramanaditya/email-service/releases/\n    :alt: GitHub Release\n.. image:: https://img.shields.io/github/stars/ramanaditya/email-service.svg?logo=github\n    :target: https://github.com/ramanaditya/email-service/stargazers\n    :alt: GitHub stars\n.. image:: https://img.shields.io/github/forks/ramanaditya/email-service.svg?logo=github\u0026color=teal\n    :target: https://github.com/ramanaditya/email-service/network/members\n    :alt: GitHub forks\n\n\n----\n\n\nSend Your email without caring about the backend code.\n\n:GitHub: `ramanaditya/email-service \u003chttps://github.com/ramanaditya/email-service\u003e`__\n:PyPI: `pypi.org/project/email-service \u003chttps://pypi.org/project/email-service\u003e`__\n\n\nUsage\n======\n\n\nInstall it with pip\n--------------------\n.. code-block:: console\n\n    $ pip install email-service\n\n\nEmail Integration\n--------------------\n``Save the`` **API_KEY** ``in the`` **.env** ``file as``\n\n\n.. code-block:: text\n\n    SENDGRID_API_KEY=api_key\n\n\nImport EmailHandler\n--------------------\n.. code-block:: python\n\n    \u003e\u003e\u003e from email_service.email_handler import EmailHandler\n\n\nForm the dictionary of data\n------------------------------\n.. code-block:: python\n\n    data = {\n        \"from_email\": \"Name WithSpace \u003cfrom_email@gmail.com\u003e\",  # Required\n        \"subject\": \"This is the test for the Individual email\", # Required\n        \"reply_to_addresses\": \"email1@gmail.com\",\n        \"html_body\": \"\u003ch1\u003eEmail Template for Individual email\u003c/h1\u003e\",    # Either of html_body or text_body is required\n        \"text_body\": \"Email Template for Individual email\",\n        \"to_for_bulk\": [{\"name\": \"Name\", \"email\": \"email@gmail.com\"},], # Required for Bulk Email\n        \"recipients\": {\n            \"to\": [{\"name\": \"name1\", \"email\": \"email1@gmail.com\"},],    # Required\n            \"cc\": [{\"name\": \"name2\", \"email\": \"email2@google.com\"},],\n            \"bcc\": [{\"name\": \"name3\", \"email\": \"email3@google.com\"},],\n        },\n        \"attachments\": [\n            \"file_path (pdf)\", \"calender invite (ics)\", \"image_path (png/jpg/jpeg)\"\n        ]\n    }\n\n\nSend the email\n-----------------\n.. code-block:: python\n\n    \u003e\u003e\u003e # For Individual Email\n    \u003e\u003e\u003e send_email = EmailHandler()\n\n    \u003e\u003e\u003e # For Bulk Email\n    \u003e\u003e\u003e send_email = EmailHandler(email_type=\"BULK\")\n\n\nSendgrid Integration\n----------------------\n.. code-block:: python\n\n    \u003e\u003e\u003e # Send it using sendgrid\n    \u003e\u003e\u003e response = send_email.sendgrid(data)\n\n\nResponse\n-----------\n.. code-block:: yaml\n\n    status_code:\n        202: OK,\n        400: Error\n    message: Error or Success Message\n\n\nDevelopment\n============\n\n.. image:: https://img.shields.io/github/languages/code-size/ramanaditya/email-service?logo=github\n    :target: https://github.com/ramanaditya/email-service/\n    :alt: GitHub code size in bytes\n.. image:: https://img.shields.io/github/repo-size/ramanaditya/email-service?logo=github\n    :target: https://github.com/ramanaditya/email-service/\n    :alt: GitHub repo size\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square\n    :target: https://github.com/ramanaditya/email-service\n    :alt: black\n\n\nSetup\n-------\n\n\nClone the repository\n^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ git clone https://github.com/ramanaditya/email-service\n\n\nCreate a virtual environment using virtualenv or venv.\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ python -m venv venv\n    $ source venv/bin/activate\n\n\nUpgrade pip\n^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ python -m pip install --upgrade pip\n\n\nInstall python packages\n^^^^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ python -m pip install -r requirements.txt\n\n\nGit Flow\n----------\n\n\nCreate new Branch from `develop` branch\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ git checkout -b develop origin/develop\n    $ git checkout -b feature_branch\n\n\nPush the Code\n^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ git add file_which_was_changed\n    $ git commit -m \"Commit Message\"\n    $ git push -u origin feature_branch\n\n\nBuild Package for Local Testing\n================================\n.. code-block:: console\n\n    $ # Build the package\n    $ python setup.py build\n\n    $ # Install the package\n    $ python setup.py install\n\n\nPyPI\n-----\n\n\nThis is just for the reference and need not to be run,\nIf you want to run these scripts, please take a note of this\n\n* For testing, we maintain the test package at `testpypi \u003chttps://test.pypi.org/project/email-service/\u003e`__\n* PyPI or Test PyPI, does not accept same file name, you can change the file name or version in the `./setup.py \u003chttps://github.com/ramanaditya/email-service/blob/main/setup.py\u003e`__\n* You will be prompted to enter\n    - Either username and password\n    - or, username as \"__token__\" and password as token (can be generated from the pypi website)\n* It will be uploaded to your pypi or testpypi account\n\n\nGenerating distribution archives\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ # Downloading latest version of setuptools\n    $ python -m pip install --user --upgrade setuptools wheel\n\n    $ python setup.py sdist bdist_wheel\n\n\nUploading to Test PyPI\n^^^^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ # Upload to Test PyPI https://test.pypi.org/\n    $ python -m twine upload --repository testpypi dist/*\n\n\nDownload the package from Test PyPI\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ python -m pip install -i https://test.pypi.org/simple/ email-service\n\n\nCheck against the code\n^^^^^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ # Edit the file inside /example to have some valid data\n    $ # export SENDGRID_API_KEY before running the script\n    $ python individual_email.py  # For individual email\n    $ python bulk.py  # For bulk email\n\n\nUploading to PyPI\n^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ # Upload to PyPI https://pypi.org/\n    $ python -m twine upload dist/*\n\n\nDownload the package from Test PyPI\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n.. code-block:: console\n\n    $ python -m pip install -i https://test.pypi.org/simple/ email-service\n\n\nIssues\n========\n\n\n.. image:: https://img.shields.io/github/issues/ramanaditya/email-service?logo=github\n    :target: https://github.com/ramanaditya/email-service/issues\n    :alt: GitHub issues\n.. image:: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat\u0026logo=git\u0026logoColor=white\n    :target: https://github.com/ramanaditya/email-service/pulls\n    :alt: PRs Welcome\n.. image:: https://img.shields.io/github/last-commit/ramanaditya/email-service?logo=github\n    :target: https://github.com/ramanaditya/email-service/\n    :alt: GitHub last commit\n\n\n+-------------+-------------+\n| Issue No.   | Issue       |\n+=============+=============+\n|             |             |\n+-------------+-------------+\n\n\n**NOTE**: **Feel free to** `open issues \u003chttps://github.com/ramanaditya/email-service/issues/new/choose\u003e`__. Make sure you follow the Issue Template provided.\n\n\nContribution Guidelines\n========================\n\n.. image:: https://img.shields.io/github/issues-pr-raw/ramanaditya/email-service?logo=git\u0026logoColor=white\n    :target: https://github.com/ramanaditya/email-service/compare\n    :alt: GitHub pull requests\n.. image:: https://img.shields.io/github/contributors/ramanaditya/email-service?logo=github\n    :target: https://github.com/ramanaditya/email-service/graphs/contributors\n    :alt: GitHub contributors\n\n\n* Write clear meaningful git commit messages (Do read `this \u003chttp://chris.beams.io/posts/git-commit/\u003e`__).\n* Make sure your PR's description contains GitHub's special keyword references that automatically close the related issue when the PR is merged. (Check `this \u003chttps://github.com/blog/1506-closing-issues-via-pull-requests\u003e`__ for more info)\n* When you make very very minor changes to a PR of yours (like for example fixing a text in button, minor changes requested by reviewers) make sure you squash your commits afterward so that you don't have an absurd number of commits for a very small fix. (Learn how to squash at `here \u003chttps://davidwalsh.name/squash-commits-git\u003e`__)\n* Please follow the `PR Template \u003chttps://github.com/ramanaditya/email-service/blob/main/.github/PULL_REQUEST_TEMPLATE.md\u003e`__ to create the PR.\n* Always open PR to ``develop`` branch.\n* Please read our `Code of Conduct \u003chttps://github.com/ramanaditya/email-service/blob/main/CODE_OF_CONDUCT.md\u003e`__.\n* Refer `this \u003chttps://github.com/ramanaditya/email-service/blob/main/CONTRIBUTING.md\u003e`__ for more.\n\n\n``If you`` ❤️ ``this`` `repository \u003chttps://github.com/ramanaditya/email-service\u003e`__ ``, support it by star 🌟``\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framanaditya%2Femail-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framanaditya%2Femail-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framanaditya%2Femail-service/lists"}