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-1.0.0.tar.gz
.
File metadata
- Download URL: mailclerk-1.0.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed9c7b1f55042650284033055401b0004a63d72729ff4e615f880561caa97eb1 |
|
MD5 | 854488b86ba874136ffe5f805ba63fee |
|
BLAKE2b-256 | 024b980bca0581d00eca071dea22ff5e6d5925280f6be38534e1b3b7fc880962 |
File details
Details for the file mailclerk-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: mailclerk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd8d580a11b4a01c65f60c4c9f13f26b60b0902d6a191fc9aaeea69ef3fecf9 |
|
MD5 | 3627cd496ee2ca189b5282c8aaf943f3 |
|
BLAKE2b-256 | f58e8c9c3a5101148b7de1e50316247b66bf52f9c3bac23a7bfa051741649964 |