Metadata-Version: 2.4
Name: message-sender
Version: 0.2.0
Summary: Sends Messages with different services such as email
Author-email: Paul Sanders <paul@paulsanders.dev>
License: MIT License
        
        Copyright (c) 2026 Paul Sanders
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: async,email,google-chat,messages
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: aiosmtplib>=5.0.0
Requires-Dist: httpx>=0.28.1
Description-Content-Type: text/markdown

# Message Sender

[![Tests Status](https://github.com/sanders41/message-sender/actions/workflows/testing.yml/badge.svg?branch=main&event=push)](https://github.com/sanders41/message-sender/actions?query=workflow%3ATesting+branch%3Amain+event%3Apush)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/sanders41/message-sender/main.svg)](https://results.pre-commit.ci/latest/github/sanders41/message-sender/main)
[![Coverage](https://codecov.io/github/sanders41/message-sender/coverage.svg?branch=main)](https://codecov.io/gh/sanders41/message-sender)
[![PyPI version](https://badge.fury.io/py/message-sender.svg)](https://badge.fury.io/py/message-sender)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/message-sender?color=5cc141)](https://github.com/sanders41/message-sender)

Sends messages with different services such as email and Google Chat.

## Installation

```sh
pip install message-sender
```

## Usage

### Google Chat

Send messages to Google Chat via webhooks. To set this up, create a "space" in Google Chat, then go
to Apps & integrations and create a new webhook.

#### Sync Client

```py
from message_sender.google_chat import GoogleChatClient

with GoogleChatClient("https://your-webhook-url.com") as client:
    client.send_message("Some test message")
```

#### Async Client

```py
from message_sender.google_chat import AsyncGoogleChatClient

async with AsyncGoogleChatClient("https://your-webhook-url.com") as client:
    await client.send_message("Some test message")
```

### Discord

Send messages to Discord via webhooks. For setup instructions see
[https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)

#### Sync Client

```py
from message_sender.discord import DiscordClient

with DiscordClient("https://your-webhook-url.com") as client:
    client.send_message("Some test message")
```

#### Async Client

```py
from message_sender.discord import AsyncDiscordClient

async with AsyncDiscordClient("https://your-webhook-url.com") as client:
    await client.send_message("Some test message")
```

### Proton Email

Send emails through Proton Mail's SMTP service. For setup instructions see
[https://proton.me/support/smtp-submission](https://proton.me/support/smtp-submission)

#### Sync Client

```py
from message_sender.email.proton import ProtonEmailClient

client = ProtonEmailClient(
    email_address="smtp_setup_email@proton.me", smtp_token="your-token"
)
client.send_email(
    message="Your message body",
    email_to="someone@email.com",
    subject="Example",
    html_content="<p>Your HTML message body</p>",  # optional
)
```

#### Async Client

```py
from message_sender.email.proton import AsyncProtonEmailClient

client = AsyncProtonEmailClient(
    email_address="smtp_setup_email@proton.me", smtp_token="your-token"
)
await client.send_email(
    message="Your message body",
    email_to="someone@email.com",
    subject="Example",
    html_content="<p>Your HTML message body</p>",  # optional
)
```
