Metadata-Version: 2.1
Name: messages-sender
Version: 0.1.3
Summary: 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.
Home-page: https://github.com/Ermite28/messages_sender
License: MIT
Author: Ermite28
Author-email: benoitdewitte28@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: Jinja2 (>=3.0.3,<4.0.0)
Requires-Dist: Telethon (>=1.24.0,<2.0.0)
Project-URL: Repository, https://github.com/Ermite28/messages_sender
Description-Content-Type: text/markdown

# Messages Sender

<p align="center">
<a href="https://github.com/psf/black/blob/main/LICENSE"><img alt="License: MIT" src="https://black.readthedocs.io/en/stable/_static/license.svg"></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>


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).

<img src=".doc/create_message.svg" alt="pipeline" style="zoom:60%;" />


## Getting Started

### Dependencies
* python3.8+

### Installing
```bash
pip install messages-sender
```

### Use it

example:
```python
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

- [X] Maybe rethink about the library interface?
- [ ] Make more example template
- [X] Handle mails attached files.
- [ ] Better error handling.
- [X] Add unit test
- [X] 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

