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>
|
||||
<artifactId>quarkus-resteasy-mutiny</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-resteasy-qute</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit5</artifactId>
|
||||
|
@ -9,7 +9,7 @@ import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import io.quarkus.mailer.Mail;
|
||||
import io.quarkus.mailer.Mailer;
|
||||
import io.quarkus.mailer.MailTemplate;
|
||||
import io.quarkus.mailer.reactive.ReactiveMailer;
|
||||
|
||||
|
||||
@ -19,12 +19,17 @@ public class MailRessource {
|
||||
@Inject
|
||||
private ReactiveMailer mail;
|
||||
|
||||
@Inject
|
||||
private MailTemplate hello;
|
||||
|
||||
|
||||
@GET
|
||||
@Path("async")
|
||||
public CompletionStage<Response> sendMail(){
|
||||
return mail.send(Mail.withText("valcze80@gmail.com", "async", "toto"))
|
||||
.subscribeAsCompletionStage()
|
||||
.thenApply(x -> Response.accepted().build());
|
||||
//return mail.send(Mail.withText("valcze80@gmail.com", "async", "toto"))
|
||||
//.subscribeAsCompletionStage()
|
||||
//.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