From 3a5d89c5fb8dc268ea80879786388af3ee9569d5 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 30 May 2022 22:41:12 +0200 Subject: [PATCH] create resources --- pom.xml | 4 ++++ .../com/covas/Resources/MailRessource.java | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/main/java/com/covas/Resources/MailRessource.java diff --git a/pom.xml b/pom.xml index 853ed70..7956250 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,10 @@ io.quarkus quarkus-smallrye-openapi + + io.quarkus + quarkus-mailer + io.quarkus quarkus-junit5 diff --git a/src/main/java/com/covas/Resources/MailRessource.java b/src/main/java/com/covas/Resources/MailRessource.java new file mode 100644 index 0000000..ff47261 --- /dev/null +++ b/src/main/java/com/covas/Resources/MailRessource.java @@ -0,0 +1,23 @@ +package com.covas.Resources; + +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; + +import io.quarkus.mailer.Mail; +import io.quarkus.mailer.reactive.ReactiveMailer; +import io.smallrye.mutiny.Uni; + +@Path("mail") +public class MailRessource { + + @Inject + private ReactiveMailer mail; + + @GET + public Uni sendMail(){ + return mail.send(Mail.withText("valcze80@gmail.com", "toto", "toto")); + } + + +}