Metadata-Version: 2.4
Name: email-service-tool
Version: 0.1.1
Summary: Async email sending utility powered by Microsoft Graph, using token-service-tool for auth.
Author-email: Shibendra Bhattacharjee <storebshiv@gmail.com>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: token-service-tool>=0.1.0
Dynamic: license-file

# 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

```bash
pip install email-service-tool
```

## Usage

```python
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"
)
```
