E-mail with text and html content provided with markdown
Project description
MarkdownMail
============
Purpose
-------
Send e-mails with generated html content.
The content has to be written in Markdown syntax. The text part of the e-mail
will be filled verbatim; the html part will be a converted HTML from the
Markdown content.
Install
-------
``$ pip install markdownmail``
Basic Usage
-----------
.. code:: python
import markdownmail
CONTENT = u"""
SPAMS AND EGGS
==============
This is a demo with a list:
1. Spam
2. Second spam
3. ...and eggs
"""
email = markdownmail.MarkdownMail(
from_addr=(u'alice@example.com', u'Alice'),
to_addr=(u'bob@example.com', u'Bob'),
subject=u'MarkdownMail demo',
content=CONTENT
)
email.send('localhost')
Content must be unicode.
Run tests
---------
Tox is automatically installed in virtualenvs before executing the tests.
Execute them with:
``$ python setup.py test``
Disable markdownmail in your tests
----------------------------------
If an instance of NullServer is passed to send() method, the e-mail is not send:
.. code:: python
email = markdownmail.MarkdownMail(
#params
)
email.send(markdownmail.NullServer())
Subclassing NullServer allows to provide a custom behaviour for the send()
method.
Useful links
------------
Envelopes library: https://pypi.python.org/pypi/Envelopes/0.4
Markdown syntax: https://daringfireball.net/projects/markdown/syntax
============
Purpose
-------
Send e-mails with generated html content.
The content has to be written in Markdown syntax. The text part of the e-mail
will be filled verbatim; the html part will be a converted HTML from the
Markdown content.
Install
-------
``$ pip install markdownmail``
Basic Usage
-----------
.. code:: python
import markdownmail
CONTENT = u"""
SPAMS AND EGGS
==============
This is a demo with a list:
1. Spam
2. Second spam
3. ...and eggs
"""
email = markdownmail.MarkdownMail(
from_addr=(u'alice@example.com', u'Alice'),
to_addr=(u'bob@example.com', u'Bob'),
subject=u'MarkdownMail demo',
content=CONTENT
)
email.send('localhost')
Content must be unicode.
Run tests
---------
Tox is automatically installed in virtualenvs before executing the tests.
Execute them with:
``$ python setup.py test``
Disable markdownmail in your tests
----------------------------------
If an instance of NullServer is passed to send() method, the e-mail is not send:
.. code:: python
email = markdownmail.MarkdownMail(
#params
)
email.send(markdownmail.NullServer())
Subclassing NullServer allows to provide a custom behaviour for the send()
method.
Useful links
------------
Envelopes library: https://pypi.python.org/pypi/Envelopes/0.4
Markdown syntax: https://daringfireball.net/projects/markdown/syntax
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
markdownmail-0.4.0.tar.gz
(6.0 kB
view details)
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 markdownmail-0.4.0.tar.gz.
File metadata
- Download URL: markdownmail-0.4.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a6ea13b6d0b1f2ffd7528da4cf6d65f753cac1c6bbacb79590605b1cea2050
|
|
| MD5 |
a108aea6d639e153daa8370edaac4b8c
|
|
| BLAKE2b-256 |
ba8f29a3df697359e66ebb510df29c35c7327f934442c951c3432046fe5c4cd9
|
File details
Details for the file markdownmail-0.4.0-py2.py3-none-any.whl.
File metadata
- Download URL: markdownmail-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccd97c9f952610314497a17daee0ac340b21f06c9bf058c8db145f9f6907a305
|
|
| MD5 |
41ce8c2b9cc9d6bc67289d714624a195
|
|
| BLAKE2b-256 |
8b71e38fcd00cf4457c985723714974243b82b38fc6eab4453ee49e9aa9a8d24
|