Metadata-Version: 2.1
Name: alerts_msg
Version: 0.0.2
Summary: All abilities to send alert msgs (threading)
Home-page: https://github.com/centroid457/
Author: Andrei Starichenko
Author-email: centroid@mail.ru
Project-URL: Source, https://github.com/centroid457/alerts_msg
Keywords: smtp,mail,email,alerts,notifications,email alerts
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Communications
Classifier: Topic :: Communications :: Email
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Typing :: Typed
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# alerts_msg


## Features

1. send emails (threading!)


## License

See the [LICENSE](LICENSE) file for license rights and limitations (MIT).


## Release history

See the [HISTORY.md](HISTORY.md) file for release history.


## Installation

```commandline
pip install alerts_msg
```

## Import

```python
from alerts_msg import *
```


## GUIDE

See tests and source for other examples.

### AlertSmtp

#### 1. add new server if not exists

```python
from alerts_msg import *

class SmtpServersMOD(SmtpServers):
    EXAMPLE_RU: SmtpAddress = SmtpAddress("smtp.EXAMPLE.ru", 123)

class AlertSmtpMOD(AlertSmtp):
    SERVER: SmtpAddress = SmtpServersMOD.EXAMPLE_RU   # or direct =SmtpAddress("smtp.EXAMPLE.ru", 123)
```

#### 2. change authorisation data (see module `private_values` for details)

```python
from alerts_msg import *

class AlertSmtpMOD(AlertSmtp):
    SMTP_USER: str = "example@mail.ru"
    SMTP_PWD: str = PrivateEnv.get("myCustomPrivateEnvName")
```

#### 3. change other settings (see source for other not mentioned)

```python
from alerts_msg import *

class AlertSmtpMOD(AlertSmtp):
    TIMEOUT_RECONNECT: int = 60
    RECONNECT_LIMIT: int = 10

    TIMEOUT_RATELIMIT: int = 600

    RECIPIENT: str = "my_address_2@mail.ru"
```

#### 4. send

* if no mods
```python
from alerts_msg import *

AlertSmtp(subj_suffix="Hello", body="World!")
```

* with mods

```python
from alerts_msg import *

class AlertSmtpMOD(AlertSmtp):
    pass    # changed

AlertSmtpMOD(subj_suffix="Hello", body="World!")
```
