ctl.plugins.email
A plugin for sending emails
Classes
EmailPlugin
EmailPlugin(ctl.plugins.PluginBase)
send emails
Class Attributes
- ConfigSchema (
ConfigSchema Class
): Base plugin config schema
Instanced Attributes
These attributes / properties will be available on instances of the class
- smtp (
@property
): smtp connection - smtp_host (
str
)
Methods
_send
def _send(self, body, subject, sender, recipient, **kwargs)
Send email, private method use send
instead
Arguments
- body (
str
): message body - subject (
str
): message subject - sender (
str
): sender address - recipient (
str
): recipient address
Keyword Arguments
- test_mode (
bool
): ifTrue
no message will be sent, but instead the message object will be returned
Returns
MIMEText
instance if test_mode
==True
alert
def alert(self, message)
wrapper for self.send
init
def init(self)
called after the plugin is initialized, plugin may define this for any other initialization code
send
def send(self, body, **kwargs)
Send email
Arguments
- body (
str
): message body
EmailPluginConfig
EmailPluginConfig(confu.schema.core.Schema)
Configuration Schema for EmailPlugin
Class Attributes
- recipients (
List<Email>
): list of recipient addresses - sender (
Email
): email sender address - smtp (
SMTPConfigSchema
): smtp connection info - subject (
Str
): email subject