Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/domenkozar/pyramid_marrowmailer
Pyramid integration package for marrow.mailer, formerly known as TurboMail.
https://github.com/domenkozar/pyramid_marrowmailer
Last synced: about 1 month ago
JSON representation
Pyramid integration package for marrow.mailer, formerly known as TurboMail.
- Host: GitHub
- URL: https://github.com/domenkozar/pyramid_marrowmailer
- Owner: domenkozar
- License: other
- Created: 2012-09-16T23:28:09.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2020-03-30T07:57:47.000Z (over 4 years ago)
- Last Synced: 2024-08-04T01:06:04.183Z (3 months ago)
- Language: Python
- Size: 17.6 KB
- Stars: 5
- Watchers: 4
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-pyramid - pyramid_marrowmailer - (Email)
README
Pyramid integration package for "A highly efficient and modular mail delivery
framework for Python 2.6+ and 3.1+, formerly TurboMail."Currently it must be used with ``pyramid_tm``, as ``.send()`` only works
if ``transaction``.commit() succeeded.INSTALL
=======::
$ env/bin/easy_install pyramid_marrowmailer
USAGE
=====If you have package installed, you can configure it in Pyramid like always::
config.include('pyramid_marrowmailer')
All settings ``marrow.mailer`` expects are prefixed with ``mail.``. If you want
to use different prefix, set it with ``pyramid_marrowmailer.prefix``.To see what options ``marrow.mailer`` support, see
`the documentation `_. Note that
boolean options need a ``.on`` suffix. For example ``mail.transport.debug.on = true``.
Options that need to be converted to integer, add ``int`` suffix. For example
``mail.transport.port.int = 1337``.``pyramid_marrowmailer`` calls ``Mailer.start`` when ``config.include('pyramid_marrowmailer')``
is called. ``atexit`` is used to register ``Mailer.stop`` to shutdown when wsgi server will exit.Note that ``pyramid_marrowmailer`` subclasses ``marrow.mailer.Mailer`` to provide support for
``transaction``. Class is importable from ``pyramid_marrowmailer.TransactionMailer``.You can access ``pyramid_marrowmailer.TransactionMailer`` instance in two ways::
message = request.mailer.new()
...
message.send()Or::
from pyramid_marrowmailer import get_mailer
mailer = get_mailer(request)
message = mailer.new()
...
message.send()EXAMPLE
=======If we have paster ``.ini`` something like::
mail.mode = direct or transaction
mail.transport.use = smtp
mail.message.author = [email protected]Inside a view, we can do::
message = request.mailer.new()
message.subject = "foobar2"
message.to = "[email protected]"
message.plain = "hi"
message.send()TESTING
=======::
$ pip install nose coverage pep8 setuptools-flakes
$ ./pre-commit-check.sh