Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

cq.mailer.DefaultMailService : RestAPI integration

Avatar

Avatar
Validate 1
Level 1
tvnavinkumar1980
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
tvnavinkumar1980
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
tvnavinkumar1980
Level 1

01-02-2021

Could I integrate an Rest full end-point in cq.mailer.DefaultMailService.

this is because, i don't have an SMTP server, but rather API end point to connect. 

AEM DefaultMailService email

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

582 likes

Total Posts

562 posts

Correct Reply

218 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

582 likes

Total Posts

562 posts

Correct Reply

218 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

01-02-2021

@tvnavinkumar1980,

Yes definitely, you can make java HttpRequest from OSGI services, sling servlet, sling models, etc... 

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://api.my-site/mail"))
        .POST(HttpRequest.BodyPublishers.ofString(requestBody))
        .build();

 

Answers (0)