Send email using markdown
Project description
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.*
========================================
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file markdown_merge-0.1.7.tar.gz.
File metadata
- Download URL: markdown_merge-0.1.7.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58ba0b68f6b4fca09da947488e7f9dd84771cc1f54a99f7cd567edaaf69c84bf
|
|
| MD5 |
fc709f6f4559187a9bfbd02e83c29bbe
|
|
| BLAKE2b-256 |
db8f3009babf5898171c932cc7fb55f4ecb4d72e2b2071f0f9a89a71b1258534
|
File details
Details for the file markdown_merge-0.1.7-py3-none-any.whl.
File metadata
- Download URL: markdown_merge-0.1.7-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38b568a1856c49311e28f3f036d9065497c590a52424bb0a913e72cc74bbcb74
|
|
| MD5 |
9f4658b37e11af47c3797f5913fd30db
|
|
| BLAKE2b-256 |
d4587ba2b0294910f60c5219606e549967145f62f5cd516fe61a2b23651a4bd4
|