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

Mailer: default mailer beans are not registered if only mail template record is used #43518

Closed
mkouba opened this issue Sep 26, 2024 · 1 comment · Fixed by #43524
Closed
Assignees
Labels
area/mailer kind/bug Something isn't working
Milestone

Comments

@mkouba
Copy link
Contributor

mkouba commented Sep 26, 2024

Describe the bug

This use case is described in the docs:

import io.quarkus.mailer.MailTemplate;
import io.quarkus.qute.CheckedTemplate;

@Path("")
public class MailingResource {

    record hello(String name) implements MailTemplateInstance { 
    }

    @GET
    @Path("/mail")
    public Uni<Void> send() {
        // the template looks like: Hello {name}! 
        return new hello("John")
           .to("[email protected]")  
           .subject("Hello from Qute template")
           .send(); 
    }
}

We should fix the condition here: https://github.com/quarkusio/quarkus/blob/main/extensions/mailer/deployment/src/main/java/io/quarkus/mailer/deployment/MailerProcessor.java#L104-L108

Expected behavior

No response

Actual behavior

Application fails with NPE.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@mkouba mkouba added the kind/bug Something isn't working label Sep 26, 2024
Copy link

quarkus-bot bot commented Sep 26, 2024

/cc @cescoffier (mailer)

@mkouba mkouba self-assigned this Sep 26, 2024
@mkouba mkouba closed this as completed in 3c243a6 Sep 26, 2024
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 26, 2024
mskacelik pushed a commit to mskacelik/quarkus that referenced this issue Sep 27, 2024
- even if only mail template record is used
- get rid of unnecessary programmatic lookup in MailTemplateProducer
- fixes quarkusio#43518
@gsmet gsmet modified the milestones: 3.16.0.CR1, 3.15.2 Nov 13, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Nov 13, 2024
- even if only mail template record is used
- get rid of unnecessary programmatic lookup in MailTemplateProducer
- fixes quarkusio#43518

(cherry picked from commit 3c243a6)
bschuhmann pushed a commit to bschuhmann/quarkus that referenced this issue Nov 16, 2024
- even if only mail template record is used
- get rid of unnecessary programmatic lookup in MailTemplateProducer
- fixes quarkusio#43518
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mailer kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants