template mail
This commit is contained in:
parent
9464408bf9
commit
4dedad4528
4
pom.xml
4
pom.xml
@ -72,6 +72,10 @@
|
|||||||
<groupId>io.quarkus</groupId>
|
<groupId>io.quarkus</groupId>
|
||||||
<artifactId>quarkus-resteasy-mutiny</artifactId>
|
<artifactId>quarkus-resteasy-mutiny</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.quarkus</groupId>
|
||||||
|
<artifactId>quarkus-resteasy-qute</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.quarkus</groupId>
|
<groupId>io.quarkus</groupId>
|
||||||
<artifactId>quarkus-junit5</artifactId>
|
<artifactId>quarkus-junit5</artifactId>
|
||||||
|
@ -9,7 +9,7 @@ import javax.ws.rs.Path;
|
|||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
import io.quarkus.mailer.Mail;
|
import io.quarkus.mailer.Mail;
|
||||||
import io.quarkus.mailer.Mailer;
|
import io.quarkus.mailer.MailTemplate;
|
||||||
import io.quarkus.mailer.reactive.ReactiveMailer;
|
import io.quarkus.mailer.reactive.ReactiveMailer;
|
||||||
|
|
||||||
|
|
||||||
@ -19,12 +19,17 @@ public class MailRessource {
|
|||||||
@Inject
|
@Inject
|
||||||
private ReactiveMailer mail;
|
private ReactiveMailer mail;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private MailTemplate hello;
|
||||||
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
|
@Path("async")
|
||||||
public CompletionStage<Response> sendMail(){
|
public CompletionStage<Response> sendMail(){
|
||||||
return mail.send(Mail.withText("valcze80@gmail.com", "async", "toto"))
|
//return mail.send(Mail.withText("valcze80@gmail.com", "async", "toto"))
|
||||||
.subscribeAsCompletionStage()
|
//.subscribeAsCompletionStage()
|
||||||
.thenApply(x -> Response.accepted().build());
|
//.thenApply(x -> Response.accepted().build());
|
||||||
|
return hello.to("valcze80@gmail.com").subject("test").data("name", "Robert").send().subscribeAsCompletionStage().thenApply(x -> Response.accepted().build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1
src/main/resources/templates/hello.txt
Normal file
1
src/main/resources/templates/hello.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Coucou {name} !
|
Loading…
x
Reference in New Issue
Block a user