Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ and more:
* DKIM signature
* Render body from template
* Flask extension and Django integration
* Message body transformation methods
* HTML transformation with CSS inlining (``pip install emails[html]``)
* Load message from url or from file

|
Expand Down
8 changes: 8 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ Install from pypi:
.. code-block:: bash

$ pip install emails

This installs the lightweight core for building and sending email messages.

To use HTML transformation features (CSS inlining, image embedding, loading from URL/file):

.. code-block:: bash

$ pip install emails[html]
3 changes: 1 addition & 2 deletions emails/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from email.header import Header, decode_header as decode_header_
from email.utils import parseaddr, formatdate, escapesre, specialsre

import requests

from . import USER_AGENT
from .exc import HTTPLoaderError

Expand Down Expand Up @@ -270,6 +268,7 @@ def __init__(self, _subtype='mixed', boundary=None, _subparts=None, encoding=Non


def fetch_url(url, valid_http_codes=(200, ), requests_args=None):
import requests
args = {}
args.update(DEFAULT_REQUESTS_PARAMS)
args.update(requests_args or {})
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def find_version(*file_paths):
'emails.packages.dkim'
],
scripts=['scripts/make_rfc822.py'],
install_requires=['cssutils', 'lxml', 'chardet', 'python-dateutil', 'requests', 'premailer'],
install_requires=['python-dateutil'],
extras_require={
'html': ['cssutils', 'lxml', 'chardet', 'requests', 'premailer'],
},
zip_safe=False,
classifiers=(
'Development Status :: 4 - Beta',
Expand Down
Loading