- 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
82 lines
1.4 KiB
GraphQL
82 lines
1.4 KiB
GraphQL
# 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: "YOUR_STOREFRONT_URL/api/webhooks/saleor"
|
|
events: [ORDER_CONFIRMED]
|
|
isActive: true
|
|
}) {
|
|
webhook {
|
|
id
|
|
name
|
|
targetUrl
|
|
isActive
|
|
}
|
|
errors {
|
|
field
|
|
message
|
|
code
|
|
}
|
|
}
|
|
|
|
orderPaidWebhook: webhookCreate(input: {
|
|
name: "Resend - Order Paid"
|
|
targetUrl: "YOUR_STOREFRONT_URL/api/webhooks/saleor"
|
|
events: [ORDER_FULLY_PAID]
|
|
isActive: true
|
|
}) {
|
|
webhook {
|
|
id
|
|
name
|
|
targetUrl
|
|
isActive
|
|
}
|
|
errors {
|
|
field
|
|
message
|
|
code
|
|
}
|
|
}
|
|
|
|
orderCancelledWebhook: webhookCreate(input: {
|
|
name: "Resend - Order Cancelled"
|
|
targetUrl: "YOUR_STOREFRONT_URL/api/webhooks/saleor"
|
|
events: [ORDER_CANCELLED]
|
|
isActive: true
|
|
}) {
|
|
webhook {
|
|
id
|
|
name
|
|
targetUrl
|
|
isActive
|
|
}
|
|
errors {
|
|
field
|
|
message
|
|
code
|
|
}
|
|
}
|
|
|
|
orderFulfilledWebhook: webhookCreate(input: {
|
|
name: "Resend - Order Fulfilled"
|
|
targetUrl: "YOUR_STOREFRONT_URL/api/webhooks/saleor"
|
|
events: [ORDER_FULFILLED]
|
|
isActive: true
|
|
}) {
|
|
webhook {
|
|
id
|
|
name
|
|
targetUrl
|
|
isActive
|
|
}
|
|
errors {
|
|
field
|
|
message
|
|
code
|
|
}
|
|
}
|
|
}
|