Skip to main content

No project description provided

Project description

.. contents::

PSERVER.MAILER
==============


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

config.json can include mailer section::

"applications": ["pserver.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": ["pserver.mailer"],
"mailer": {
"default_sender": "foo@bar.com",
"endpoints": {
"default": {
"type": "smtp",
"host": "localhost",
"port": 25
}
},
"utility": "pserver.mailer.utility.PrintingMailerUtility"
}


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

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

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


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

`pserver.mailer` defines a permission `mailer.SendMail` which, by default,
only the `plone.SiteAdmin` role is assigned.


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

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

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

1.0.1 (unreleased)
------------------

- nothing yet...

1.0.0 (2017-02-01)
------------------

- Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pserver.mailer-1.0.1.dev0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

pserver.mailer-1.0.1.dev0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file pserver.mailer-1.0.1.dev0.tar.gz.

File metadata

File hashes

Hashes for pserver.mailer-1.0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 9ca99e8936a9452a135d5ff1ba8526ff11bfa6b6c0068d08c59810cde958dc50
MD5 c214cf85830ac35ebaf5b0d1950054cd
BLAKE2b-256 50d458545672185cf7e71b3cc1213aae610a237a74b1092192b572f841865993

See more details on using hashes here.

File details

Details for the file pserver.mailer-1.0.1.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for pserver.mailer-1.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 33870b44bad71afd7713d29d0a04b49df0c8eee34577af4e149e944694f31639
MD5 5380b8cde9f4e604a6cf75dc42813e55
BLAKE2b-256 ee35e4ebe1c01469b7daaaf52d3619145e2de1f43764ab45168d0362d0b764a5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page