{"id":20107346,"url":"https://github.com/kurlov/aiohttp-sendgrid","last_synced_at":"2025-05-06T09:32:34.874Z","repository":{"id":57408939,"uuid":"115857925","full_name":"kurlov/aiohttp-sendgrid","owner":"kurlov","description":"SendGrid mail API wrapper","archived":false,"fork":false,"pushed_at":"2019-05-19T04:35:27.000Z","size":26,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T00:35:51.341Z","etag":null,"topics":["aiohttp","api-wrapper","asyncio","low-latency","python","sendgrid"],"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/kurlov.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2017-12-31T10:58:39.000Z","updated_at":"2023-09-16T07:06:54.000Z","dependencies_parsed_at":"2022-09-26T17:10:23.078Z","dependency_job_id":null,"html_url":"https://github.com/kurlov/aiohttp-sendgrid","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/kurlov%2Faiohttp-sendgrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurlov%2Faiohttp-sendgrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurlov%2Faiohttp-sendgrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurlov%2Faiohttp-sendgrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurlov","download_url":"https://codeload.github.com/kurlov/aiohttp-sendgrid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252657419,"owners_count":21783818,"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":["aiohttp","api-wrapper","asyncio","low-latency","python","sendgrid"],"created_at":"2024-11-13T17:56:28.097Z","updated_at":"2025-05-06T09:32:34.518Z","avatar_url":"https://github.com/kurlov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"aiohttp-sendgrid\n================\n.. image:: https://travis-ci.org/Kurlov/aiohttp-sendgrid.svg?branch=master\n    :target: https://travis-ci.org/Kurlov/aiohttp-sendgrid\n.. image:: https://badge.fury.io/py/aiohttp-sendgrid.svg\n    :target: https://badge.fury.io/py/aiohttp-sendgrid\n\nSendGrid mail API wrapper\n\nInstallation\n------------\n``pip install aiohttp_sendgrid``\n\nUsage\n-----\nCreate an instance of API client:\n\n.. code:: python\n\n    import asyncio\n    from aiohttp_sendgrid import Sendgrid\n    api_key = '\u003cyour_sendgrid_api_key\u003e'\n    mailer = Sendgrid(api_key=api_key)\n\nImportant to note that if ``api_key`` is not provided then it will try to\nread ``SENDGRID_API_KEY`` environment variable\n\nSend email to single recipient\n-------------------------------\n.. code:: python\n\n    to = 'to@example.com'\n    sender = 'from@example.com'\n    subject = 'greetings'\n    content = '\u003ch1\u003eHello\u003c/h1\u003e'\n    send_mail = mailer.send(to, sender, subject, content)\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(send_mail)\n\nBoth ``to`` and ``sender`` might be also a dictionary with ``email`` key,\nif you want to specify name for sender or recipient then add ``name`` key to\nthe dictionary. Thus, ``to = {'email': 'to@example.com', 'name': 'Recipient'}``\nis also a correct value.\n\nSend single email to multiple recipients\n----------------------------------------\n.. code:: python\n\n    to = ['to@example.com', 'another@example']\n    sender = 'from@example.com'\n    subject = 'greetings'\n    content = '\u003ch1\u003eHello\u003c/h1\u003e'\n    send_mail = mailer.send(to, sender, subject, content)\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(send_mail)\n\n``to`` might be tuple or list of strings or dictionaries.\nExample of valid input::\n\n           'name@example.com'\n           {'email': 'name@example.com'}\n           {'email': 'name@example.com', 'name': 'Name'}\n           ['name@example.com']\n           ['name@example.com', 'name2@example.com']\n           [{'email': 'name@example.com'}]\n           [{'email': 'name@example.com'}, {'email': 'name2@example.com'}]\n           [{'email': 'name@example.com', 'name': 'Name'}]\n           [{'email': 'name@example.com', 'name': 'Name'},\n            {'email': 'name2@example.com', 'name': 'Name2'}]\n           ['name@example.com', {'email': 'name2@example.com'},\n            {'email': 'name3@example.com', 'name': 'Name3'}]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurlov%2Faiohttp-sendgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurlov%2Faiohttp-sendgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurlov%2Faiohttp-sendgrid/lists"}