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

Enable access for Qute Template Instance within a Mail Template Instance #20536

Closed
ahofmeister opened this issue Oct 5, 2021 · 3 comments · Fixed by #20765
Closed

Enable access for Qute Template Instance within a Mail Template Instance #20536

ahofmeister opened this issue Oct 5, 2021 · 3 comments · Fixed by #20765
Assignees
Labels
area/mailer kind/enhancement New feature or request
Milestone

Comments

@ahofmeister
Copy link

ahofmeister commented Oct 5, 2021

Description

We are sending emails based on a Qute Template.

In order to see the actual template filled with data, it would be nice to provided an REST endpoint like GET /templates/user-registration?userId=2711. Maybe for other team members (or PO/PM), that are not familiar with the Quarkus World (or even Java) but want to give feedback or see the template filled with data.

I know this is working for plain Qute Template Instances. See following example:

@CheckedTemplate
  static class Templates {
    public static native TemplateInstance hello();
  }


  @GET
  @Consumes(MediaType.TEXT_HTML)
  public TemplateInstance testMail() {
    return Templates.hello();
  }
  

It's not the same as for Mail Template Instances, because the underlying TemplateInstance is private and not exposed via any method.

See also following discussion:
https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Convert.20.20MailTemplateInstance.20to.20TemplateInstance

Implementation ideas

See: https://github.com/quarkusio/quarkus/blob/main/extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/MailTemplateInstanceImpl.java#L23

Maybe just add a getter for the underlying template instance.

@ahofmeister ahofmeister added the kind/enhancement New feature or request label Oct 5, 2021
@quarkus-bot quarkus-bot bot added area/mailer area/qute The template engine labels Oct 5, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 5, 2021

/cc @cescoffier, @mkouba

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 5, 2021

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip.

This message is automatically generated by a bot.

@mkouba mkouba added this to the 2.4 - main milestone Oct 5, 2021
@aloubyansky aloubyansky modified the milestones: 2.4.0.CR1, 2.4.0.Final Oct 11, 2021
@mkouba mkouba self-assigned this Oct 14, 2021
mkouba added a commit to mkouba/quarkus that referenced this issue Oct 14, 2021
@mkouba mkouba removed the area/qute The template engine label Oct 14, 2021
aloubyansky pushed a commit to aloubyansky/quarkus that referenced this issue Oct 18, 2021
@ahofmeister
Copy link
Author

@mkouba Thanks. The use case popped up again and it's working. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mailer kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants