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

  • Register the smtp endpoint [vangheem]

1.0.1 (2017-04-10)

  • remove dependencies on repoze.sendmail and transaction [vangheem]

  • Test mailer did not provide correct signature [vangheem]

1.0.0 (2017-04-04)

  • Initial release moved from guillotina_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.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

guillotina_mailer-1.0.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for guillotina_mailer-1.0.2.tar.gz
Algorithm Hash digest
SHA256 152454ed6cda9447ce00106b924078f869be75d9bb040cfe2b90adf478f04cae
MD5 b19f16dc3d55c85b9600787274b5cb33
BLAKE2b-256 89b5b486918b8c6590fa9cf97e8c9c7a51fd3c5da6e09faca5f4c47e538c20fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for guillotina_mailer-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 baf4c2f9e01624e133ad421719f68c8fa0bccfd0c0e800aeb5456c75ab3af653
MD5 0a2fa02dc39f6daf5182ef0af43f2a01
BLAKE2b-256 dcc834e47c98e2e0d438de1f4724b77fdd9998f268dccbf2a5f943d340e63648

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