semvec/pypi-packages huggingface dataset:
django-mail-utils 0.3
Django mail mixins and utilities
License: MIT

=================
django-mail-utils
=================

Django mail mixins and utilities.

Contents
========
TemplateMixin
-------------
The mixin allows to create email body from a template (any text file).

| ``template_name`` - a path to a template in one of TEMPLATE_DIRs.
| ``template_context`` - a dictionary of variables passed to a template.

Both ``template_name`` and ``template_context`` can be set in inherited classes or
updated from constructor parameters.

Also you can pass the template string like the constructor's ``body`` parameter.
Then it will be used to render the real email's body.

EnvelopeMixin
-------------
The mixin allows to predefine email parameters ``subject``, ``from_email``, ``to``,
``cc`` and ``bcc``.

Parameters may be overridden via ``__init__``.

ImagesMixin
-----------
The mixin allows to embed images into email via ``<img src="cid:<your image>">`` in HTML.
To enable this functionality set ``images`` and ``images_root`` class fields.

| ``images_root`` - a root path to resolve image paths (e.g. ``os.path.dirname(__file__)`` or ``os.getcwd()``)
| ``images`` - a list of paths to images (e.g. ``['logo.png']`` or ``['email_images/logo.png']``)

Installation
============
::

    pip install django-mail-utils
::


Examples
========

TemplateMixin
--------------------
::

    from mail_utils import TemplateMixin

    
    class RegistrationEmail(TemplateMixin, EmailMessage):
        template_name = 'emails/registration.html'       
        template_context = {'from': 'Acme Corporation'}
::

EnvelopeMixin
---------------------
::

    from mail_utils import EnvelopeMixin
    
    class NotificationEmail(EnvelopeMixin, EmailMessage):
        subject = 'Admin News'
        from_email = ADMIN_EMAIL
        to = COLLEGUES_EMAILS
        cc = CC_EMAILS
        bcc = BCC_EMAILS
::

ImagesMixin
-----------
::

    from mail_utils import TemplateMixin, ImagesMixin

    class CoolEmail(ImagesMixin, TemplateMixin, EmailMessage):
        template_name = 'email.html'
        images_root = os.path.dirname(__file__)
        images = ['logo.png', 'phone_icon.png']
::

In HTML use ``<img src="cid:<path from images>">`` to embed an image.

::
       
    <img src="cid:logo.png" /> Company
       
    <img src="cid:phone_icon.png"> Call us
::
bild.me-cli 0.1.1
CLI tool for bild.me
License: MIT
Keywords: bild.me,CLI

|Build| |PyPI version|


* GitHub: https://github.com/mozillazg/bild.me-cli
* Free software: MIT license
* PyPI: https://pypi.python.org/pypi/bild.me-cli
* Python version: 2.6, 2.7, pypy, 3.3, 3.4


Installation
------------

To install bild.me-cli, simply:

.. code-block:: bash

    $ pip install bild.me-cli


Usage
------

.. code-block:: console

    $ bild -f test1.png test2.png
    test1.png: [==================================================>]
    http://s1.bild.me/bilder/260513/4053120test1.png
    test2.png: [==================================================>]
    http://s1.bild.me/bilder/260513/1932235test2.png

    $ bild -q -f test1.png test2.png
    http://s1.bild.me/bilder/260513/3599206test2.png
    http://s1.bild.me/bilder/260513/8204314test1.png

    $ bild -qf *.png
    http://s1.bild.me/bilder/260513/3041575test2.png
    http://s1.bild.me/bilder/260513/6296743test1.png

    $ bild -h
    usage: bild [-h] [-V] [-l] [-q] -f FILE [FILE ...]

    CLI tool for bild.me.

    optional arguments:
      -h, --help            show this help message and exit
      -V, --version         show program's version number and exit
      -l, --list            list all result
      -q, --quiet           decrease verbosity
      -f FILE [FILE ...], -F FILE [FILE ...], --file FILE [FILE ...]
                            picture file path, support Unix shell-style wildcards


.. |Build| image:: https://api.travis-ci.org/mozillazg/bild.me-cli.png?branch=master
   :target: https://travis-ci.org/mozillazg/bild.me-cli
.. |PyPI version| image:: https://pypip.in/v/bild.me-cli/badge.png
   :target: https://crate.io/packages/bild.me-cli


Changelog
=========

0.1.1 (2014-04-30)
------------------

* [change] use multi-thread instead of multi-process
* [change] use sys.stderr output error message
* [new] support progress bar
* [new] add [-q|--quiet] argument for hide progress bar
* [new] file path support Unix shell-style wildcards


0.1.0 (2014-04-28)
------------------

* Initial Release