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
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).
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for messages_sender-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7763dc903e852b1558a294bf0e9ec9b061810d0da264e4a9a76024df1274bfa |
|
MD5 | 840a106f8d398b5c289cc502da215dd2 |
|
BLAKE2b-256 | 0ce6cfea8c9f2d11206b1c8daa590f8ef677ed5f6dbeff64e7b66cc694fa9cf3 |