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.1.2 (2018-11-21)

  • Adding options for username and passwd [bloodbare]

1.1.1 (2018-11-15)

  • Fix getting empty settings [vangheem]

1.1.0 (2018-09-17)

  • Use a retriable async queue to send emails [vangheem]

1.0.5 (2018-09-12)

  • Fix tests [vangheem]

1.0.4 (2018-09-12)

  • Fix queue [vangheem]

1.0.3 (2018-09-12)

  • Fix to make work with latest guillotina [vangheem]

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.1.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

guillotina_mailer-1.1.2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: guillotina_mailer-1.1.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for guillotina_mailer-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1a651561dc1fc44182b92208bc9791ed2f16797de356157f330a6e8d841f9adc
MD5 35b49af8c489e0307bad9589e4e7fe6e
BLAKE2b-256 1f5c3be2f1cda92a17070d8f93cc02d95dcb5d33a22c3839929313bb94cb1d25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: guillotina_mailer-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for guillotina_mailer-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 123fb598b70004a55049041e10bc26830ee36fafb682abad3acb3298f3f978e1
MD5 e4293ee7533be7882fc71bf21d046c27
BLAKE2b-256 6d9cad70aa26cf9e79918e6f5b529106d1e6efdf6ee0b57c0ab073adab4dfbb9

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