groupe-sii / ogham

Sending email, sms or whatever is a piece of cake
https://groupe-sii.github.io/ogham/
Apache License 2.0
21 stars 15 forks source link

Provide configurers for mainly used service providers #78

Open aurelien-baudet opened 5 years ago

aurelien-baudet commented 5 years ago

Provide a simple automatic way to configure email sending through Gmail, Yahoo, ... It could be something like this with fluent API:

.email()
  .gmail()
    .account()
      .username()
      .applicationPassword()

An using properties:

ogham.email.gmail.account.username=
ogham.email.gmail.account.application-password=

And nothing else to do. It will automatically configure correctly the SMTP configuration

aurelien-baudet commented 4 years ago

A new configuration phase has been added. New configurers can now be created just to provide some default values only if some conditions are met (like a value of a property).

In addition to "ServiceProviderBuilder"s, an automatic configuration could be applied (and still overriden by developer): if smtp.host belongs to gmail, then the port, ssl and other parameters are automatically set.