fix(email): Remove false "free shipping" promise from mentor gift card email - #57
Closed
detail-app[bot] wants to merge 1 commit into
Closed
detail-app[bot] wants to merge 1 commit into
detail-app[bot] wants to merge 1 commit into
Conversation
Member
|
We do not charge for shipping. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detail bug report: View on Detail
Bug
After a CodeDay event, the "Issue Mentor Giftcard" activity mints a Shopify code via
issueGiftcard(src/shopify/issueGiftcard.ts) and emails it to each mentor. The Shopify mutation creates an amount-off discount (discountCodeBasicCreatewithcustomerGets.value.discountAmount), which per Shopify's API applies only to the eligible item subtotal and cannot waive the shipping line. However, the delivery email (src/email/templates/giftCard.md) promised the recipient "free shipping," so every mentor redeeming the gift was presented with an unexpected, non-zero checkout balance equal to the unwaived shipping charge — a fee the app explicitly told them would not apply. The mismatch was introduced together in2a004dc.Fix
Removed the false "with free shipping" promise from
giftCard.mdso the email truthfully describes only the$amountcredit the issued discount actually grants. The checkout-instruction line now reads "Use this code at checkout to receive the $X credit: ...".The Shopify issuing path is intentionally left unchanged: switching to
giftCardCreateor adding adiscountCodeFreeShippingCreatecode would change benefit issuance and couldn't be verified against Shopify, risking breaking code creation entirely. Correcting the email's promise resolves the user-visible defect with a minimal, low-risk change. Added a regression-guard test ensuring the template never re-promises free shipping while its underlying discount cannot honor it.Testing
tsc --noEmit), the full build, the kept unit test, and the existingtests/testSlackReporting.tsall pass — no regressions.tests/testGiftCardTemplate.ts): assertsgiftCard.mdcontains no "free shipping" promise, guarding against re-introducing the exact mismatch that went undetected here. Follows the repo's existing manual unit-test pattern (no CI test runner is configured).sendGiftcardcode path two ways — with a stub SMTP transport at the DI boundary, and again against a live local SMTP server I started on a free port — for both the featured-product and plain-giftcard branches. The rendered/sent emails no longer mention "free shipping" and still state the$10.00credit, the code, the store link, the one-month expiry, and the email signature. (These driver scripts were temporary and are not part of the PR; the verification was done locally.)issueGiftcardagainst the store configured in the repo's.env.example(test.myshopify.com), but Shopify returnedHTTP 401[API] Invalid API key or access token— the configured credentials are placeholders and no real Shopify test store/token is available in this environment. BecauseissueGiftcardis unchanged and I can't reach a live Shopify checkout here, the runtime shipping-line behavior at checkout couldn't be exercised; a regression-guard assertion still confirms the issuing source usesdiscountAmountas before.Automatic Fixes PRs can be configured here.