Skip to main content

Mailer integration with guillotina

Project description

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.0.0 (2017-04-04)

  • Initial release moved from pserver.mailer

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

guillotina_mailer-1.0.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

guillotina_mailer-1.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file guillotina_mailer-1.0.0.tar.gz.

File metadata

File hashes

Hashes for guillotina_mailer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 896746a82c18555fc74a4059b9e381ddc105cdccc9b8061f9463e69520dd2b96
MD5 d3b8117b5454f7898be3a427a0ee69ac
BLAKE2b-256 9bf885262c3fb1c1f7956c1a220ae498b63a6537485f083827ffccc584767fc8

See more details on using hashes here.

File details

Details for the file guillotina_mailer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for guillotina_mailer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e7b4e05929bac553c1d285878003742a42a50b56d72bb6c1f18e2525e9a3598
MD5 fd14dfcfdde211c42bf6b9bbf0bbde10
BLAKE2b-256 a0c81f6168c378e08503f2a2801c5d8f7194db195fda8d520442876ab4359447

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