java.lang.Object
io.jooby.commons.mail.CommonsMailModule
- All Implemented Interfaces:
io.jooby.Extension
commons email.
Small but helpful module that provides access to Email
instances via the service
registry and Config
.
usage
application.conf:mail.hostName = smtp.googlemail.com mail.ssl.onConnect = true mail.username = username mail.password = password mail.from = user@gmail.com mail.subject = TestMail
{ install(new CommonsEmailModule()); get("/send", ctx -> { require(SimpleEmail.class) .setMsg("you got an email!") .setTo("foo@bar.com") .send(); }); }
That's all it does! Every time you require an email, it creates one and setup properties from
mail.*
.
- Since:
- 2.8.9
- Author:
- edgar
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aCommonsMailModule
.CommonsMailModule
(String name) Creates aCommonsMailModule
. -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jooby.Extension
lateinit
-
Constructor Details
-
CommonsMailModule
Creates aCommonsMailModule
.- Parameters:
name
- Name of the property who has the mail information. Default is:mail.*
.
-
CommonsMailModule
public CommonsMailModule()Creates aCommonsMailModule
.
-
-
Method Details
-
install
public void install(@NonNull io.jooby.Jooby application) - Specified by:
install
in interfaceio.jooby.Extension
-