Skip to main content

Sends Messages with different services such as email

Project description

Message Sender

Tests Status pre-commit.ci status Coverage PyPI version PyPI - Python Version

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

Installation

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

from message_sender.google_chat import GoogleChatClient

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

Async Client

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

Sync Client

from message_sender.discord import DiscordClient

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

Async Client

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

Sync Client

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

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
)

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

message_sender-0.2.0.tar.gz (47.6 kB view details)

Uploaded Source

Built Distribution

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

message_sender-0.2.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file message_sender-0.2.0.tar.gz.

File metadata

  • Download URL: message_sender-0.2.0.tar.gz
  • Upload date:
  • Size: 47.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for message_sender-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d7e115a47457169c2d1a9ab83dc4e965fb788822f17ea87a5f3528651289325
MD5 318544e5fa5087300ccf84ae9c517f5d
BLAKE2b-256 f74727d1904dd5cd1fba4e41fe409bcadfed693940094f53e34c590a0d1a64f5

See more details on using hashes here.

File details

Details for the file message_sender-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: message_sender-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for message_sender-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4cc14bfe7cb6bbb0bcdd5906ba7d3c71d980ddcf9d96e65dbd54346e1eb8b39a
MD5 cfac28ba75dce1c5bfa7c2522b39b3fa
BLAKE2b-256 9e877adee23e953d8f831a289504e84d18f9465662e0a79e387255893a8521eb

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