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

Feat/email load globalTemplateVars async #2950

Conversation

mschipperheyn
Copy link
Collaborator

Description

This PR adds an async function call as an alternative to the static globalTemplateVars in the Email-Plugin. The function receives the RequestContext and the Injector. It has the objective to allow you to load theme variables that may be specific to e.g. a channel. Such as a footer text or color schemes, etc

I did get a whole bunch of eslint related warnings when I committed this and had to use --no-verify. But they didn't apply to my code.

I'm assuming documentation is extracted from the inline docs I added. Not sure how that works.

Breaking changes

Screenshots

You can add screenshots here if applicable.

Checklist

📌 Always:

  • [x ] I have set a clear title
  • [ x] My PR is small and contains a single feature
  • [x ] I have checked my own PR

👍 Most of the time:

  • [ x] I have added or updated test cases
  • [ x] I have updated the README if needed

Copy link

vercel bot commented Jul 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Jul 16, 2024 4:57pm

@mschipperheyn mschipperheyn changed the title Feat/email generator vars wrapper Feat/email load globalTemplateVars async Jul 16, 2024
Copy link
Member

@michaelbromley michaelbromley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work: clean code, good test case, excellent docs 👍

One small change needed on a doc block, and also please target the minor branch rather than master.

*
* @docsCategory core plugins/EmailPlugin
* @docsPage EmailPluginOptions
* @docsWeight 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting docsWeight 0 will force this type to the top of the EmailPluginOptions docs page, which is not what we want. Better to have the main EmailPluginOptions interface at the top. So remove this to be safe add it to the EmailPluginOptions doc block to ensure it always stays at the top.

@michaelbromley michaelbromley merged commit cab67b6 into vendure-ecommerce:master Jul 17, 2024
12 of 13 checks passed
@michaelbromley
Copy link
Member

Since the master will be merged into minor today anyway with the upcoming release, I decided to merge anyway, since the time-zone difference would delay things.

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants