Skip to main content

Message sender is a library which create a message to send from a python dictionnary and a Jinja template and send it by the method of your choice.

Project description

Messages Sender

License: MIT Code style: black

Format and send a message following a template.

Description

Message sender is a library which create a message to send from a python dictionnary and a Jinja template and send it by [the method of your choice](##Send methods available).

pipeline

Getting Started

Dependencies

  • python3.8+

Installing

pip install messages-sender

Use it

example:

from messages-sender import MessageSender
credentials = {
    "SMTP": {
        "port": 465,
        "password": "your_mail_password",
        "sender_email": "your_mail",
    },
}
method = "smtp"
template = "templates/mail_template.jinja"
message = {
    "subject": "Test",
    "core": "The results of your analyse are available.",
    "results": {"link": "https://github.com/Ermite28/messages_sender", "label": "See the result"},
    "greetings": "Best regards,\nBenoît de Witte",
    "senders": {"info": "Ermite28, Belgium"},
}
MessageSender(credentials=credentials, method=method, template=template).send_message("your_email", message=message)

TODO

  • Maybe rethink about the library interface?
  • Make more example template
  • Handle mails attached files.
  • Better error handling.
  • Add unit test
  • should it handle file (config, template, message)? NO

Send methods available

:white_check_mark: Telegram

:white_check_mark: SMTP

:red_circle: local

:red_circle: Signal

:red_circle: RSS

:red_circle: SMS

:red_circle: Discord bot

:red_circle: message_senders API (futur project)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

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

messages_sender-0.1.3.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

messages_sender-0.1.3-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

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