Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small doc adjustments for the Mailer guides #39377

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -263,8 +263,8 @@
== Testing email sending

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,7 +305,10 @@
}
----

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.
If you need fine control on how the mail is sent, for instance if you need to retrieve the message ids, you can inject the underlying client, and use it directly:
Expand Down
8 changes: 7 additions & 1 deletion 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 Expand Up @@ -223,7 +229,7 @@ The xref:mailer-reference.adoc[mailer reference guide] provides more details abo
* xref:mailer-reference.adoc#html[how to format the email as HTML and use inline attachments]
* xref:mailer-reference.adoc#templates[how to use Qute templates]
* xref:mailer-reference.adoc#testing[how to test applications sending emails]
* xref:mailer-reference.adoc#gmail-specific-configuration[how to configure the mailer to send emails with GMAIL]
* xref:mailer-reference.adoc#popular[how to configure the mailer for popular email services (e.g. Gmail, AWS SES)]



Loading