Skip to content

fix(email): Remove false "free shipping" promise from mentor gift card email - #57

Closed
detail-app[bot] wants to merge 1 commit into
mainfrom
detail/bug-fix/fix-email-remove-false-free-shipping-promise-from-2df788
Closed

detail-app[bot] wants to merge 1 commit into
mainfrom
detail/bug-fix/fix-email-remove-false-free-shipping-promise-from-2df788

Conversation

@detail-app

@detail-app detail-app Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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 (discountCodeBasicCreate with customerGets.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 in 2a004dc.

Fix

Removed the false "with free shipping" promise from giftCard.md so the email truthfully describes only the $amount credit 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 giftCardCreate or adding a discountCodeFreeShippingCreate code 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

  • Routine checks pass: typecheck (tsc --noEmit), the full build, the kept unit test, and the existing tests/testSlackReporting.ts all pass — no regressions.
  • Kept test (tests/testGiftCardTemplate.ts): asserts giftCard.md contains 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).
  • End-to-end (email path): I exercised the real sendGiftcard code 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.00 credit, 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.)
  • Could not verify live Shopify redemption/admin issuance: I attempted the real issueGiftcard against the store configured in the repo's .env.example (test.myshopify.com), but Shopify returned HTTP 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. Because issueGiftcard is 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 uses discountAmount as before.

Automatic Fixes PRs can be configured here.

@tylermenezes

Copy link
Copy Markdown
Member

We do not charge for shipping.

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.

1 participant