refactor: abstract site URL across email templates

- Add NEXT_PUBLIC_SITE_URL to .env.local
- Update email templates to accept siteUrl prop
- Update webhook handler to pass siteUrl from env var
- Update create-webhooks.graphql with placeholder URL
This commit is contained in:
Unchained
2026-03-25 10:33:03 +02:00
parent b8b3a57e6f
commit 4fcd4b3ba8
7 changed files with 36 additions and 13 deletions

View File

@@ -1,7 +1,11 @@
# Replace YOUR_STOREFRONT_URL with your actual storefront URL
# Dev: https://dev.manoonoils.com
# Prod: https://manoonoils.com
mutation CreateSaleorWebhooks {
orderConfirmedWebhook: webhookCreate(input: {
name: "Resend - Order Confirmed"
targetUrl: "https://manoonoils.com/api/webhooks/saleor"
targetUrl: "YOUR_STOREFRONT_URL/api/webhooks/saleor"
events: [ORDER_CONFIRMED]
isActive: true
}) {
@@ -20,7 +24,7 @@ mutation CreateSaleorWebhooks {
orderPaidWebhook: webhookCreate(input: {
name: "Resend - Order Paid"
targetUrl: "https://manoonoils.com/api/webhooks/saleor"
targetUrl: "YOUR_STOREFRONT_URL/api/webhooks/saleor"
events: [ORDER_FULLY_PAID]
isActive: true
}) {
@@ -39,7 +43,7 @@ mutation CreateSaleorWebhooks {
orderCancelledWebhook: webhookCreate(input: {
name: "Resend - Order Cancelled"
targetUrl: "https://manoonoils.com/api/webhooks/saleor"
targetUrl: "YOUR_STOREFRONT_URL/api/webhooks/saleor"
events: [ORDER_CANCELLED]
isActive: true
}) {
@@ -58,7 +62,7 @@ mutation CreateSaleorWebhooks {
orderFulfilledWebhook: webhookCreate(input: {
name: "Resend - Order Fulfilled"
targetUrl: "https://manoonoils.com/api/webhooks/saleor"
targetUrl: "YOUR_STOREFRONT_URL/api/webhooks/saleor"
events: [ORDER_FULFILLED]
isActive: true
}) {