Metadata-Version: 2.1
Name: guillotina-mailer
Version: 1.1.1
Summary: Mailer integration with guillotina
Home-page: https://github.com/pyrenees/guillotina_mailer
Author: Nathan Van Gheem
Author-email: nathan.vangheem@wildcardcorp.com
License: BSD
Keywords: async mail guillotina
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: setuptools
Requires-Dist: guillotina
Requires-Dist: html2text
Requires-Dist: aiosmtplib

.. contents::

guillotina_mailer
=================


Configuration
-------------

config.json can include mailer section::

    "applications": ["guillotina_mailer"],
    "mailer": {
      "default_sender": "foo@bar.com",
      "endpoints": {
        "default": {
          "type": "smtp",
          "host": "localhost",
          "port": 25
        }
      }
    }


Printing mailer
---------------

For development/debugging, you can use a console print mailer::

    "applications": ["guillotina_mailer"],
    "mailer": {
      "default_sender": "foo@bar.com",
      "endpoints": {
        "default": {
          "type": "smtp",
          "host": "localhost",
          "port": 25
        }
      },
      "utility": "guillotina_mailer.utility.PrintingMailerUtility"
    }


Sending mail
------------

POST http://localhost:8080/zodb/container/@mailer::

    {
      "sender": "foo@bar.com",
      "recipient": "john@doe.com",
      "subject": "Some subject",
      "text": "Hello"
    }


Permissions
-----------

`guillotina_mailer` defines a permission `mailer.SendMail` which, by default,
only the `guillotina.ContainerAdmin` role is assigned.


Using the mailer in code
------------------------

You can also directly use the mailer in your code::

    from guillotina.component import queryUtility
    from guillotina_mailer.interfaces import IMailer
    mailer = queryUtility(IMailer)
    await mailer.send(recipient='john@doe.com', subject='This is my subject', text='Body of email')

1.1.1 (2018-11-15)
------------------

- Fix getting empty settings
  [vangheem]

1.1.0 (2018-09-17)
------------------

- Use a retriable async queue to send emails
  [vangheem]

1.0.5 (2018-09-12)
------------------

- Fix tests
  [vangheem]

1.0.4 (2018-09-12)
------------------

- Fix queue
  [vangheem]


1.0.3 (2018-09-12)
------------------

- Fix to make work with latest guillotina
  [vangheem]

1.0.2 (2017-04-13)
------------------

- Register the smtp endpoint
  [vangheem]


1.0.1 (2017-04-10)
------------------

- remove dependencies on repoze.sendmail and transaction
  [vangheem]

- Test mailer did not provide correct signature
  [vangheem]


1.0.0 (2017-04-04)
------------------

- Initial release moved from guillotina_mailer


