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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pserver.mailer-1.0.1.dev0.tar.gz
.
File metadata
- Download URL: pserver.mailer-1.0.1.dev0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ca99e8936a9452a135d5ff1ba8526ff11bfa6b6c0068d08c59810cde958dc50 |
|
MD5 | c214cf85830ac35ebaf5b0d1950054cd |
|
BLAKE2b-256 | 50d458545672185cf7e71b3cc1213aae610a237a74b1092192b572f841865993 |
File details
Details for the file pserver.mailer-1.0.1.dev0-py3-none-any.whl
.
File metadata
- Download URL: pserver.mailer-1.0.1.dev0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33870b44bad71afd7713d29d0a04b49df0c8eee34577af4e149e944694f31639 |
|
MD5 | 5380b8cde9f4e604a6cf75dc42813e55 |
|
BLAKE2b-256 | ee35e4ebe1c01469b7daaaf52d3619145e2de1f43764ab45168d0362d0b764a5 |