Skip to main content
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 <https://github.com/marrow/marrow.mailer>`_. 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 accces ``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 = foobar@foo.com

Inside a view, we can do::

message = request.mailer.new()
message.subject = "foobar2"
message.to = "foobar2@bar.com"
message.plain = "hi"
message.send()


TESTING
=======

::

$ pip install nose coverage pep8 setuptools-flakes
$ ./pre-commit-check.sh
Changelog
=========


0.2 (2018-07-11)
----------------

- #2: mailer without use of transaction
[Remco Verhoef]

- #3: encoding file fix
[Sandro Nardi]

- #4: sortKey must be a string under Python 3
[nandoflorestan]


0.1 (2012-09-17)
----------------

- Initial release.
[Domen Kožar]


Release files for pyramid_marrowmailer 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyramid_marrowmailer 0.2
File Size Uploaded
pyramid_marrowmailer-0.2.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyramid_marrowmailer 0.2
File Interpreter ABI Platform
pyramid_marrowmailer-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / pyramid_marrowmailer-0.2.tar.gz

Download URL pyramid_marrowmailer-0.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f6a00f8d16174eb2338a1ca9c309c3730113be9e7b3bc6b152ea228ea5606df5
BLAKE2b-256 checksum
How to use checksums
bd69a95958843835deee0157b54b17b65049275b09493887bce7a7014a605f0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyramid_marrowmailer-0.2-py3-none-any.whl

Download URL pyramid_marrowmailer-0.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33d76d50787dcd4722f443d5084045653e4038a8fa671f409a0e4966ea3040be
BLAKE2b-256 checksum
How to use checksums
a3d905d009e33e6fe0c53b1fe5514c853d5b5f6e435187c88ca2db2f22996fbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page