apicrud.messaging.format¶
format.py
MIME and SMS formatting
created 15-aug-2020 by docker@instantlinux.net
Functions
|
Format an email message with mime attachment, in the user’s profile-determined locale |
|
Format an SMS message |
-
apicrud.messaging.format.
email
(content, frm, sender_email, to, settings, db_session, i18n, **kwargs)¶ Format an email message with mime attachment, in the user’s profile-determined locale
- Parameters
content (str) – i18n dict
frm (Contact) – contact of sender
sender_email (str) – destination address
to (Contact) – contact of recipient
settings (obj) – account settings
db_session – database session
i18n – localization context
**kwargs – other key=value pairs for jinja2 substitution
- Returns
mime object (use .as_string() to convert to message)
- Return type
obj
-
apicrud.messaging.format.
sms
(content, frm, to, **kwargs)¶ Format an SMS message
- Parameters
content (str) – i18n dict
frm (Contact) – contact of sender
to (Contact) – contact of recipient
**kwargs – other key=value pairs for jinja2 substitution
- Returns
Formatted string content
- Return type
str