Skip to content

Latest commit

 

History

History
145 lines (55 loc) · 2.88 KB

File metadata and controls

145 lines (55 loc) · 2.88 KB

class easy_notifyer.clients.mailer.Mailer(*, host, port, login, password, ssl=False)

Object for send mail

connect()

Connect to smtp-server and create session

disconnect()

Terminate session

login()

Create session with login/password

send_message(*, message=None, from_addr, to_addrs, subject=None, attach=None, filename=None)

Send email.

  • Parameters

    • message (str*, *optional) – Text body of message.

    • from_addr (str*, *optional) – the address sending this mail.

    • to_addrs (str*, list(str)**, *optional) – addresses to send this mail to.

    • subject (str*, *optional) – subject of the mail.

    • attach (bytes*, str, tuple, *optional) – file to send.

    • filename (str*, *optional) – filename for attached file.

easy_notifyer.clients.telegram module

class easy_notifyer.clients.telegram.Telegram(*, token, chat_id, api_url=None)

Client of telegram

send_attach(attach, *, msg=None, filename=None, disable_notification=False)

Send file.

  • Parameters

    • attach (bytes*, str, *tuple) – file to send. if tuple, then (‘filename.txt’, b’text of file’).

    • msg (str*, *optional) – text of message.

    • filename (str*, *optional) – filename if attach is string or bytes.

    • disable_notification (bool) – True to disable notification of message.

  • Return type None

send_message(msg, disable_notification=False, disable_web_page_preview=False)

Send message.

  • Parameters

    • msg (str) – text of message.

    • disable_notification (bool) – True to disable notification of message.

    • disable_web_page_preview (bool) – True to disable web preview for links.

  • Return type None

class easy_notifyer.clients.telegram.TelegramAsync(*, token, chat_id, api_url=None)

Bases: easy_notifyer.clients.telegram.TelegramBase

Async client for telegram

async send_attach(attach, *, msg=None, filename=None, disable_notification=False)

Send file.

  • Parameters

    • attach (bytes*, str, *tuple) – file to send. if tuple, then (‘filename.txt’, b’text of file’).

    • msg (str*, *optional) – text of message.

    • filename (str*, *optional) – filename if attach is string or bytes.

    • disable_notification (bool) – True to disable notification of message.

  • Return type None

async send_message(msg, disable_notification=False, disable_web_page_preview=False)

Send message.

  • Parameters

    • msg (str) – text of message.

    • disable_notification (bool) – True to disable notification of message.

    • disable_web_page_preview (bool) – True to disable web preview for links.

  • Return type None