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.0.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.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: email_service_tool-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8aa4a5a709c8c919aade9ef141f09658e4a99a3cc27e67b0e007848cfe08f8fa
MD5 4e71b2ca82abd3c1d158cb66c502ed0c
BLAKE2b-256 58687948125cad6d6e89d81325a3b2086f9d53ca3a24f23d181c2ddca872ea86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for email_service_tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4420f3ff4feb65f08e729776bc47e2b524a7fd8c70b3adfe224186e3429a6aa
MD5 db4be85af4d7ebaa4f825af0790a2c0b
BLAKE2b-256 3630a5a85470f0c9f7968ff174751f284e2249f0762e967addb39539b65ab311

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