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

Enhance Stripe Plugin to Support Localized Order Confirmation Emails #3298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HerclasNido
Copy link

Description

This PR introduces updates to the Stripe Plugin to enable sending localized order confirmation emails based on the customer's language, rather than defaulting to English. Here's a summary of the changes:

  • Added languageCode to Stripe Metadata: When creating a paymentIntent, the languageCode is now included in the metadata along with channelToken, orderId, and orderCode.
  • Localized Context for Webhook Requests: When processing Stripe webhook requests at the /payments/stripe endpoint, the createContext() function now uses the languageCode from the metadata to set the context's language. This replaces the previous behavior of defaulting to LanguageCode.en.

These changes allow the languageCode passed during the createStripePaymentIntent mutation to be accessible in the EmailTemplateLoader for the "order-confirmation" event, ensuring emails are sent in the correct language.

Breaking changes

No breaking change

Checklist

📌 Always:

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

👍 Most of the time:

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

This is my first PR, so I’m not entirely sure if everything is correct. I’d appreciate any feedback to help me improve! 😊

Copy link

vercel bot commented Dec 27, 2024

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

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Dec 27, 2024 2:23am

Copy link
Contributor

github-actions bot commented Dec 27, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@HerclasNido
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Dec 27, 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.

Hi, thanks for this PR! It all looks good to me. The only thing I'd like you to change is to remove the package-lock.json file from the PR since I guess that should not have changed?

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