Send mail with mailclerk.app
Project description
Mailclerk Python
Mailclerk helps anyone on your team design great emails, improve their performance, and free up developer time. Learn more
Table of Contents
- Requirements
- Setup
- API Key & URL
- Usage
- Varying API Keys
- Tests
- Versioning
- Code of Conduct
- Contributions
- License
- History
Requirements
- Python 2.7+ or Python 3.4+
Setup
To install, run:
pip install mailclerk
API Key & URL
To set the Mailclerk API Key (begins with mc_
), you can provide it as an
environmental variable: MAILCLERK_API_KEY
. Alternatively, you can
set it directly on the Mailclerk module:
import mailclerk
mailclerk.api_key = "mc_yourprivatekey"
If you are using version control like git, we strongly recommend storing your production API keys in environmental variables.
The default API endpoint is https://api.mailclerk.app
. To change this, you
can provide a MAILCLERK_API_URL
ENV variable or set mailclerk.mailclerk_url
.
Usage
You'll need an active account and at least one template (in the example welcome-email
).
To send an email to "alice@example.com":
mailclerk.deliver("welcome-email", "alice@example.com")
If the template has any dynamic data, you can include it in the third parameter as a hash:
mailclerk.deliver("welcome-email", "alice@example.com", { name: "Alice" })
See Mailclerk documentation for more details.
Varying API Keys
If you need to use multiple API keys, you can also initialize mailclerk.MailclerkAPIClient
instances with different keys. This:
mc_client = mailclerk.MailclerkAPIClient("mc_yourprivatekey")
mc_client.deliver("welcome-email", "bob@example.com")
Is equivalent to this:
mailclerk.api_key = "mc_yourprivatekey"
mailclerk.deliver("welcome-email", "bob@example.com")
Tests
Tests aren't currently implemented.
Versioning
Read Semantic Versioning for details. Briefly, it means:
- Major (X.y.z) - Incremented for any backwards incompatible public API changes.
- Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
- Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
Code of Conduct
Please note that this project is released with a CODE OF CONDUCT. By participating in this project you agree to abide by its terms.
Contributions
Read CONTRIBUTING for details.
License
Copyright 2021 Mailclerk. Read LICENSE for details.
History
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
Built Distribution
File details
Details for the file mailclerk-0.1.0.tar.gz
.
File metadata
- Download URL: mailclerk-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bda70348c0bef8848de5476ed611559c6e6e07829c07199eef11084b6a49ccc |
|
MD5 | 842192845a25ab8084940413bc93cf81 |
|
BLAKE2b-256 | 958fe0facd47825053c5338475bce8df1cfe5e0df9c79401209d91423e60f55e |
File details
Details for the file mailclerk-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: mailclerk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfc6faed6381b38f9bc84bbbf6a6159e8265e54060d6938a50bcf7c9c639f4be |
|
MD5 | e88699e3b0252d4ae782fc7373f28d39 |
|
BLAKE2b-256 | c6be786bf53233bed597c07e7a0837c3108aef44fc0f5104fb83c5c2dd32e065 |