Skip to main content

Async email sending utility powered by Microsoft Graph, using token-service-tool for auth.

Project description

email-service-tool

email-service-tool is an async email sending utility powered by Microsoft Graph API.

It automatically uses token-service-tool to fetch OAuth2 access tokens with the Client Credentials flow.


Installation

pip install email-service-tool

Usage

from email_service_tool import EmailService

email_service = EmailService(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    tenant_id="YOUR_TENANT_ID",
    scope="https://graph.microsoft.com/.default",
    sender_email="no-reply@yourdomain.com",
    graph_base_url="https://graph.microsoft.com/v1.0",
)

result = await email_service.send_email(
    to_emails=["user@example.com"],
    subject="Hello!",
    html_body="<h1>Welcome</h1>",
    api_url="https://graph.microsoft.com/v1.0/users/YOUR_SENDER_ID/sendMail"
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

email_service_tool-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

email_service_tool-0.1.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file email_service_tool-0.1.1.tar.gz.

File metadata

  • Download URL: email_service_tool-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for email_service_tool-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fc7469cdcb5406a118f5188eeb1d27825d0bcce95658a81a602a87c9076f3dfc
MD5 e48eb98fb621030cd55237975107284c
BLAKE2b-256 d5e51388948e2e7caf377fff21a6c5553bf6d3310c107b40c06311f92dcbe8b8

See more details on using hashes here.

File details

Details for the file email_service_tool-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for email_service_tool-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc2d914361be6d9fbb0599f9e8e9371ff82d3f60953983686a424e95f6e4c838
MD5 61353a80ca491c2a0a29836c7521add1
BLAKE2b-256 c0eb776da83946b83e51b0f5d351141f31bff1e216978f2793abc207dfc4c002

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page