apicrud.messaging.send¶
send.py
Send a message TODO redesign this as a class, it evolved from the oldest crappy script
created 18-apr-2019 by richb@instantlinux.net
Functions
|
Open an SMTP connection to the account’s defined smtp_smarthost |
|
|
Exceptions
-
exception
apicrud.messaging.send.
SendException
¶
-
apicrud.messaging.send.
smtp_session
(settings, db_session)¶ Open an SMTP connection to the account’s defined smtp_smarthost
- Parameters
settings (obj) – settings object
-
apicrud.messaging.send.
to_contact
(db_session, smtp=None, frm=None, to=None, template=None, account_id=None, settings=None, attachments=[], **kwargs)¶ - Parameters
db_session (obj) – open session to database
smtp (obj) – open session to SMTP smarthost
frm (uid) – person
to (Contact) – recipient
template (str) – jinja2 template name
account_id (str) – ID of logged-in account
settings (obj) – the AccountSettings for the account
attachments (list) – additional MIMEBase / MimeText objects
kwargs – kv pairs
- Raises