Orders: Sample Use Case & Flow
This article shares a possible use case your app could support, as well as a sample flow that could support the use case. This can be a helpful jumping off point as you plan your app's implementation.
Send an email on successful payment of online orders
Site owners can use your app to reach out to their customers and send a confirmation email that a payment was successful. To begin, create an email template to use for these messages. Site owners can also design their own with their email marketing dashboard.
To listen for successful payments and send a confirmation email to the customer, follow this flow:
- Listen for any new payments using the Payment Webhook.
- When the webhook is triggered, check for a
wixAppId
of1522827f-c56c-a5c9-2ac9-00f9e6ae12d3
(the Wix App ID for Pricing Plans) and extract thewixAppOrderId
. - Call Get Order using the
wixAppOrderId
as theid
for the order to retrieve. - Extract the
order.buyer.memberId
to retrieve the buyer'smemberId
. - Use the ID to Get Member and extract the member's
loginEmail
. - Call Query Email Subscriptions and filter by the email address to confirm that the member has agreed to receive emails from the site owner.
- Use Get or Create Conversation and Send Message to send an email to the buyer.
Was this helpful?
Yes
No