MarkdownMerge
Install
pip install markdown_merge
How to use
Provide your SMTP server settings, e.g. for AWS SES
import os
servernm = 'email-smtp.us-west-2.amazonaws.com'
username = os.getenv('SES_SMTP_USER')
password = os.getenv('SES_SMTP_PASS')
smtp_cfg = dict(host=servernm, port=587, user=username, password=password, use_ssl=False, use_tls=True)
You can configure your SMTP server settings using the smtp_cfg
dictionary format shown above. The example uses AWS SES with environment
variables for credentials.
Provide your email details
from_addr = get_addr('XXX@fastmail.com', 'Jeremy Howard')
to_addrs = [get_addr('douglas@example.com', 'Douglas Adams'),
get_addr('cleese@example.com', 'John Cleese')]
inserts = [{'special': "Thanks for all the fish."},
{'special': "That was a silly walk."}]
msg = """## Hello there!
Here is your special message: *{special}*"""
ml = MarkdownMerge(to_addrs, from_addr, 'A message', msg, smtp_cfg=smtp_cfg, inserts=inserts, test=True)
The test=True parameter prints the messages instead of sending them.
Send your messages
ml.send_msgs()
To: Douglas Adams <douglas@example.com>
----------------------------------------
## Hello there!
Here is your special message: *Thanks for all the fish.*
========================================
To: John Cleese <cleese@example.com>
----------------------------------------
## Hello there!
Here is your special message: *That was a silly walk.*
========================================
Release files for markdown-merge 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| markdown_merge-0.1.8.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markdown_merge-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.5 kB
Release files / markdown_merge-0.1.8.tar.gz
| Download URL | markdown_merge-0.1.8.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d8aa403b9e678fbc726c69c87c9111c93821fc3ffc1ce143a82e40eff01f10a4
|
|
BLAKE2b-256 checksum How to use checksums |
518156c9ba78fe5b80f15d5f942fd8a497f9fb584e5d1e8ccdbfac54003a7cee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / markdown_merge-0.1.8-py3-none-any.whl
| Download URL | markdown_merge-0.1.8-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e1f88cd3187bb3513e359d1c51e3fb0f0d309bdd57e2069d361a1af24ff037b
|
|
BLAKE2b-256 checksum How to use checksums |
a7b6f49199ae78cc3c7419ee9261270dab942ce558d69a2676bfe523b9b07b71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|