Skip to main content

Client service, to send simple text emails or, using a template created at MittePro, send more complex emails.

In order to use this library, you must create an account in MittePro.

** It is not currently possible to create an account in MittePro, but will soon be **

How to install:

pip install mittepro-py

Note: the install name is mittepro-py, but the import name stays mittepro:

from mittepro.client import MittePro

Follow the examples below to send simple emails or emails with templates:

Simple Emails:

from mittepro.models import Mail
from mittepro.client import MittePro

mittepro = MittePro(key='<your_account_public_key>', secret='<your_account_secret_key>')

def send(self):
    mail = Mail(
        recipient_list=[
            'Foo Bar <foo.bar@gmail.com>',
            'Fulano <fulano@gmail.com>',
            '<ciclano@gmail.com>'
        ],
        message="Just a Test, delete if you want.",
        from_='Beutrano <beutrano@mail.com>',
        subject="Just a test"
    )
    response = mittepro.send(mail)

Template Emails:

from mittepro.models import Mail
from mittepro.client import MittePro

mittepro = MittePro(key='<your_account_public_key>', secret='<your_account_secret_key>')

def send(self):
    mail = Mail(
        recipient_list=[
            'Foo Bar <foo.bar@gmail.com>',
            'Fulano <fulano@gmail.com>',
            '<ciclano@gmail.com>'
        ],
        from_='Beutrano <beutrano@mail.com>',
        template_slug='test-101',
        context={'foobar': True},
        context_per_recipient={
            "foo.bar@gmail.com": {"foo": True},
            "fulano@gmail.com.br": {"bar": True}
        },
        use_tpl_default_subject=True,
        use_tpl_default_email=False,
        use_tpl_default_name=False
    )
    response = mittepro.send_template(mail)

Mail Parameters:

Parameter Type Required Description
recipient_list List Yes List of all the recipients. The expected format is 'Name <email>' or '<email>'.
subject String Yes* The subject of the email. *In case your sending an email with template and pass use_tpl_default_subject as True then you don't need to pass the subject.
message_text String Yes* The message of the email on text format. *Only Required if your gonna send a simple text email.
message_html String No The message of the email on html format. *If pass this then you don't need to pass the template_slug
tags Dict/List No The tags must be an dictionary containing keys and simple values or an list with strings.
from_ String No* The email of the sender. The expected format is 'Name <email>' or '<email>'. *In case your sending an email with template and pass use_template_email as true then you don't need to pass this parameter.
from_email String Yes* The email of the sender. *In case your sending an email with template and pass use_tpl_default_email as True then you don't need to pass the from_email.
template_slug String No The template_slug is the slug of the template. *Just pass this if your gonna send a email with template.
use_tpl_default_name Bool No* If set to True it use the default value set to the sender's name.
use_tpl_default_email Bool No* If set to True it use the default value set to the sender's email.
use_tpl_default_subject Bool No* If set to True it use the default value set to the subject.
expose_recipients_list Bool No* If set to True every recipient will see the entire list of recipients.
get_text_from_html Bool No* If set to True mittepro will extract from your html template an text version. This will only happen if your template doesn't already have an text version.
activate_tracking Bool No* If set to True mittepro will track if your email will be open and how many times. Also it will track any links clicked inside the email.
context Dict No Global variables use in the Template. The format is expressed in the example (above).
context_per_recipient Dict No Variables set for each recipient. The format is expressed in the example (above).

Client Parameters:

Parameter Type Required Description
key String Yes Your account's public key in the MittePro.
secret String Yes Your account's private key in the MittePro.
fail_silently Bool No If set to True the lib will raise it's exceptions. Default False.

Metadata

Release files for mittepro-py 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mittepro-py 1.0.0
File Size Uploaded Provenance
mittepro_py-1.0.0.tar.gz 17.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mittepro-py 1.0.0
File Interpreter ABI Platform
mittepro_py-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / mittepro_py-1.0.0.tar.gz

Download URL mittepro_py-1.0.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
15ed5bee4fcc1325b6b899b73a266e9bdca31a69f761296218b8c994090d6e70
BLAKE2b-256 checksum
How to use checksums
079263133d2075f615ed544bc8bd59e35648600e17b1fc019d914726bfbfe051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.18

Release files / mittepro_py-1.0.0-py3-none-any.whl

Download URL mittepro_py-1.0.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab81c77d6d1e9d72e3eae8c8ba234f429cd2b9dd6eb068e913382d58fc376ebc
BLAKE2b-256 checksum
How to use checksums
3b07eb80a82f210a3f683f0c3f6785d97695b1c541937fe18393ea34acc95e3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.18

Security for mittepro-py 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page