-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6723c37
commit fdd4ecf
Showing
8 changed files
with
173 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,9 +66,9 @@ To send a simple email, proceed as follows: | |
[source, java] | ||
---- | ||
// Imperative API: | ||
mailer.send(Mail.withText("[email protected]", "A simple email from quarkus", "This is my body.")); | ||
mailer.send(Mail.withText("[email protected]", "A simple email from quarkus", "This is my body.").setFrom("[email protected]")); | ||
// Reactive API: | ||
Uni<Void> stage = reactiveMailer.send(Mail.withText("[email protected]", "A reactive email from quarkus", "This is my body.")); | ||
Uni<Void> stage = reactiveMailer.send(Mail.withText("[email protected]", "A reactive email from quarkus", "This is my body.").setFrom("[email protected]")); | ||
---- | ||
|
||
For example, you can use the `Mailer` in an HTTP endpoint as follows: | ||
|
@@ -78,14 +78,14 @@ For example, you can use the `Mailer` in an HTTP endpoint as follows: | |
@GET | ||
@Path("/imperative") | ||
public void sendASimpleEmail() { | ||
mailer.send(Mail.withText("[email protected]", "A simple email from quarkus", "This is my body")); | ||
mailer.send(Mail.withText("[email protected]", "A simple email from quarkus", "This is my body").setFrom("[email protected]")); | ||
} | ||
@GET | ||
@Path("/reactive") | ||
public Uni<Void> sendASimpleEmailAsync() { | ||
return reactiveMailer.send( | ||
Mail.withText("[email protected]", "A reactive email from quarkus", "This is my body")); | ||
Mail.withText("[email protected]", "A reactive email from quarkus", "This is my body").setFrom("[email protected]")); | ||
} | ||
---- | ||
|
||
|
@@ -96,6 +96,20 @@ You can create new `io.quarkus.mailer.Mail` instances from the constructor or fr | |
`Mail.withHtml` helper methods. | ||
The `Mail` instance lets you add recipients (to, cc, or bcc), set the subject, headers, sender (from) address... | ||
|
||
Most of these properties are optional, but the sender address is required. It can either be set on an individual `Mail` instances using | ||
|
||
[source,java] | ||
---- | ||
.setFrom("[email protected]"); | ||
---- | ||
|
||
or a global default can be configured, using | ||
|
||
[source,properties] | ||
---- | ||
[email protected] | ||
---- | ||
|
||
You can also send several `Mail` objects in one call: | ||
|
||
[source, java] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters