Skip to content

Commit

Permalink
Add notes about Quarkus Mailpit
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Mar 12, 2024
1 parent 212ef81 commit 4cf4481
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/src/main/asciidoc/mailer-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Note that does not mean that the message is delivered, just that it's been sent

Because it is very inconvenient to send emails during development and testing, you can set the `quarkus.mailer.mock` boolean
configuration to `true` to prevent the actual sending of emails but instead print them on stdout and collect them in a `MockMailbox` bean instead.

Check warning on line 266 in docs/src/main/asciidoc/mailer-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'stdout'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'stdout'?", "location": {"path": "docs/src/main/asciidoc/mailer-reference.adoc", "range": {"start": {"line": 266, "column": 79}}}, "severity": "WARNING"}
This is the default if you are running Quarkus in `DEV` or `TEST` mode.
This is the default if you are running Quarkus in dev or test mode.

You can then write tests to verify that your emails were sent, for example, by a REST endpoint:

Expand Down Expand Up @@ -305,6 +305,9 @@ class MailTest {
}
----

Another option is to use the https://github.com/quarkiverse/quarkus-mailpit[Quarkus Mailpit] extension
which provides Dev Services for https://github.com/axllent/mailpit[Mailpit], a nice UI for testing and debugging email sending.

== Using the underlying Vert.x Mail Client

Check warning on line 311 in docs/src/main/asciidoc/mailer-reference.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'Using the underlying Vert.x Mail Client'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'Using the underlying Vert.x Mail Client'.", "location": {"path": "docs/src/main/asciidoc/mailer-reference.adoc", "range": {"start": {"line": 311, "column": 4}}}, "severity": "INFO"}

The Quarkus Mailer is implemented on top of the https://vertx.io/docs/vertx-mail-client/java/[Vert.x Mail Client], providing an asynchronous and non-blocking way to send emails.
Expand Down
6 changes: 6 additions & 0 deletions docs/src/main/asciidoc/mailer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ It prints it in the log, so you can check that what was about to be sent.
NOTE: This section used the _imperative_ mailer API.
It blocks the caller thread until the mail is sent.

[TIP]
====
The https://github.com/quarkiverse/quarkus-mailpit[Quarkus Mailpit] extension is very handy for testing emails.
It provides Dev Services for https://github.com/axllent/mailpit[Mailpit], a nice UI for testing and debugging email sending.
====

== Using the reactive mailer

The last section use the _imperative_ mailer.
Expand Down

0 comments on commit 4cf4481

Please sign in to comment.