Skip to content

plone/guillotina_mailer

Repository files navigation

config.json can include mailer section:

"applications": ["guillotina_mailer"],
"mailer": {
  "default_sender": "foo@bar.com",
  "endpoints": {
    "default": {
      "type": "smtp",
      "host": "localhost",
      "port": 25
    }
  }
}

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"
}

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

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

guillotina_mailer defines a permission mailer.SendMail which, by default, only the guillotina.ContainerAdmin role is assigned.

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')

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages