fix: update order-fulfilled and order-cancelled webhooks to forward to N8N

- Update GraphQL fragments to include languageCode and all necessary fields
- Modify order-fulfilled.ts to forward to N8N instead of sending directly
- Modify order-cancelled.ts to forward to N8N instead of sending directly
- Regenerate GraphQL types with full order data
- Enable multi-language emails for shipped and cancelled orders
This commit is contained in:
Unchained
2026-03-28 13:58:29 +02:00
parent 2065b24d7a
commit 1089f03ee3
7 changed files with 1080 additions and 116 deletions
+79 -2
View File
@@ -2,12 +2,89 @@ fragment OrderCancelledWebhookPayload on OrderCancelled {
order {
id
number
created
status
userEmail
languageCode
channel {
slug
}
user {
email
firstName
lastName
}
status
shippingAddress {
firstName
lastName
streetAddress1
streetAddress2
city
postalCode
country {
country
}
phone
}
billingAddress {
firstName
lastName
streetAddress1
streetAddress2
city
postalCode
country {
country
}
phone
}
lines {
id
quantity
unitPrice {
gross {
amount
currency
}
}
totalPrice {
gross {
amount
currency
}
}
variant {
name
sku
product {
name
media {
url
}
}
}
}
subtotal {
gross {
amount
currency
}
}
shippingPrice {
gross {
amount
currency
}
}
total {
gross {
amount
currency
}
}
metadata {
key
value
}
}
}
}
+4
View File
@@ -82,5 +82,9 @@ fragment OrderCreatedWebhookPayload on OrderCreated {
currency
}
}
metadata {
key
value
}
}
}
+80 -2
View File
@@ -2,17 +2,95 @@ fragment OrderFulfilledWebhookPayload on OrderFulfilled {
order {
id
number
created
status
userEmail
languageCode
channel {
slug
}
user {
email
firstName
lastName
}
status
shippingAddress {
firstName
lastName
streetAddress1
streetAddress2
city
postalCode
country {
country
}
phone
}
billingAddress {
firstName
lastName
streetAddress1
streetAddress2
city
postalCode
country {
country
}
phone
}
lines {
id
quantity
unitPrice {
gross {
amount
currency
}
}
totalPrice {
gross {
amount
currency
}
}
variant {
name
sku
product {
name
media {
url
}
}
}
}
subtotal {
gross {
amount
currency
}
}
shippingPrice {
gross {
amount
currency
}
}
total {
gross {
amount
currency
}
}
metadata {
key
value
}
fulfillments {
id
status
created
trackingNumber
}
}
}
}