Reference

Data models

class django_mail_template.models.Configuration(id, process, mail_template, description)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class django_mail_template.models.MailTemplate(id, title, to, cc, bcc, from_email, subject, body, reply_to, description)[source]
exception DoesNotExist
exception MultipleObjectsReturned
bcc

Field with email’s destinies to be blind copied.

cc

Field with email’s destinies to be copied.

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

from_email

Field with sender (from) email address.

reply_to

Field with email’s reply to.

send(context=None)[source]

When sending an email a set of attributes will be required.

The required attributes are mainly dictated by django.core.mail used to send mail: * Message or body. * Subject. * Recipients list or to. * From email

Parameters

context – A dictionary with context variables to be used with the subject and the message.

Returns

A tuple (result, message) where result is a boolean indicating if mail could be sent or not. An a message in case the mail could not be sent the message will be the reason. This could have future uses if logging is implemented.

subject

Subject for the mail. Context variable can be used

title

Title for mail template

to

Field with destiny email address.