Metadata-Version: 2.4
Name: markdown_merge
Version: 0.1.5
Summary: Send email using markdown
Home-page: https://github.com/AnswerDotAI/markdown_merge
Author: Jeremy Howard
Author-email: github@jhoward.fastmail.fm
License: Apache Software License 2.0
Keywords: email mail markdown template
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: markdown
Provides-Extra: dev
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# MarkdownMerge


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

`pip install markdown_merge`

## How to use

### Provide your SMTP server settings, e.g. for AWS SES

``` python
import os
```

``` python
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

``` python
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}*"""
```

``` python
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

``` python
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.*
    ========================================
