Models

class mailrobot.models.AbstractNamedModel(*args, **kwargs)

Bases: django.db.models.base.Model

class Meta
abstract = False
AbstractNamedModel.NAME_MAX_LENGTH = 40
AbstractNamedModel.clone()

Clone and return a Named model

AbstractNamedModel.natural_key()
class mailrobot.models.Address(*args, **kwargs)

Bases: django.db.models.base.Model

Address(id, address, comment)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Address.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Address.bcc
Address.cc
Address.natural_key()
Address.recipients
Address.reply_to
Address.sender
class mailrobot.models.MailBody(*args, **kwargs)

Bases: mailrobot.models.AbstractNamedModel

Subject and bodytext of the email

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MailBody.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

MailBody.mail
class mailrobot.models.Mail(*args, **kwargs)

Bases: mailrobot.models.AbstractNamedModel

Canned Mail with default sender, Reply-To and recipients

Verifies that there is a sender and at least one recipient.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Mail.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Mail.attach_signature(context=None)

Attach signature, if any

Mail.bccs
Mail.body
Mail.ccs
Mail.clone()

Clone and return a Mail

Use this to send the same MailBody to several sets of recipients.

Mail.content
Mail.get_bccs(additional=())

Get recipients for BCC:

May be empty.

Mail.get_ccs(additional=())

Get recipients for CC:

May be empty.

Mail.get_recipients(additional=(), required=True)

Get recipients for To: and ensures there is at least one.

Email lacking anything in To: is likely spam.

Mail.get_reply_to(reply_to=u'')

Reply-To may be empty

Mail.get_sender(sender=None)

Sender may not be empty

Mail.make_content(context=None)

Generate the content (body + signature) from django templates and context

Mail.make_message(sender=None, recipients=(), ccs=(), bccs=(), reply_to=None, headers=None, context=None)

Generate a django.core.mail.EmailMessage

sender and reply_to may be overridden. recipients, ccs and bccs may be supplemented.

Verfies that there is a sender and at least one recipient.

Mail.make_subject(context=None)

Generate the subject from a django template and context

Mail.recipients
Mail.reply_to
Mail.send(**kwargs)

Use django’s email backend system to send the Mail

Mail.sender
Mail.signature
Mail.subject
Mail.validate_addresses(sender=None, recipients=(), ccs=(), bccs=())
class mailrobot.models.Signature(*args, **kwargs)

Bases: mailrobot.models.AbstractNamedModel

Email signature

No validation as to size.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Signature.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Signature.attach(context=None)

Signature is attached so:

the final line of content

– signature

Signature.mail
Read the Docs v: v0.3
Versions
latest
v0.3
v0.2
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.