rattail.mail
¶
Email Framework
-
rattail.mail.
send_email
(config, key, data={}, subject=None, recipients=None, attachments=None, finalize=None, template_key=None, fallback_key=None)[source]¶ Send an email message using configuration, exclusively.
Assuming a key of
'foo'
, this should require something like:[rattail.mail] # second line overrides first, just a plain ol' Mako search path templates = rattail:templates/email myproject:templates/email foo.subject = [Rattail] Foo Alert foo.from = rattail@example.com foo.to = general-manager@examle.com store-manager@example.com foo.cc = department-heads@example.com foo.bcc = admin@example.com
And, the following templates should exist, say in
rattail
:rattail/templates/email/foo.txt.mako
rattail/templates/email/foo.html.mako
The
data
parameter will be passed directly to the template object(s).The implementation should look for available template names and react accordingly, e.g. if only a plain text is provided then the message will not be multi-part at all (unless an attachment(s) requires it). However if both templates are provided then the message will include both parts.