Skip to main content

MittePro is a powerful marketing tool with features to help companies with their marketing goals and deliver emails from their websites and apps.

Project description

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

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 and an template_slug MittePro is going to ignore the template's html.

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.

template_slug - String - Yes* - 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mittepro-2.4.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distributions

mittepro-2.4.1-py3.7.egg (26.8 kB view details)

Uploaded Source

mittepro-2.4.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file mittepro-2.4.1.tar.gz.

File metadata

  • Download URL: mittepro-2.4.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.5

File hashes

Hashes for mittepro-2.4.1.tar.gz
Algorithm Hash digest
SHA256 5dfbc9a4f9fa126d28809c111fc8f9eece0b3a0e0e29e50e8f3354304e7d2678
MD5 f0de2c6f8c3e33add1938361516a9fb7
BLAKE2b-256 8ccca47bec04717e534320a4d27beefa7809c280430da9c30f87871b92fec500

See more details on using hashes here.

File details

Details for the file mittepro-2.4.1-py3.7.egg.

File metadata

  • Download URL: mittepro-2.4.1-py3.7.egg
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.5

File hashes

Hashes for mittepro-2.4.1-py3.7.egg
Algorithm Hash digest
SHA256 1cdbe1b0e7f37042800df9c869f3f6bdf9150eaa6833e889639b101f2831183a
MD5 88a523041ad36eb80013d70c13b6f56f
BLAKE2b-256 e394bda6fc6db072ceeede9b7373ee01c36357ae8dc32d1694f3d599df00d816

See more details on using hashes here.

File details

Details for the file mittepro-2.4.1-py3-none-any.whl.

File metadata

  • Download URL: mittepro-2.4.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.5

File hashes

Hashes for mittepro-2.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aea49be826ccc92f056cfcb272508fb4aa8178425fae5e5abc4884f3e25ce554
MD5 b8e017685b69197f8da4e8d046bd9fb2
BLAKE2b-256 2c4c8b435679f7a3eb548a71ff8c833b9b9e887ce8ecca6fdc9e825046426e75

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page