Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi all, I am trying to set up Shopfiy Flows to send payment reminders at set intervals (on due date, 3 days past due, 7 days, 14 days, etc.), but I want to send them to custom recipients using the same metafields in this flow https://admin.shopify.com/apps/flow/web/editor/templates/b4dfb34a-33d4-4894-a59b-b571a4af99f2 . The base structure of the payment reminders is here https://admin.shopify.com/apps/flow/web/editor/templates/4d2841f9-1847-499f-8995-f1427f8d4163 .
The problem with the payment reminders standard Flow is that it just sends to the main contact of B2B companies, and although you can customise the invoice Flow to add a custom message, a Flow that starts with the 'Payment schedule is due' trigger then fails as it cannot find the correct order ("Ran into exception: Fields: order_id are required but are empty").
I would appreciate any guidance anyone can offer.
Adam
Solved! Go to the solution
This is an accepted solution.
I would remove that For-Each path entirely and instead just get each of the 3 metafield values directly (no looping). Choose "metafield (requires arguments)" instead of metafields.
You cannot currently force an action to use a different ID as it's auto-assigned. But changing that data is has access to should work
Can you post a screenshot of that error and your full workflow?
Sure, thanks for replying. Here are the screenshots below
You don't have an "order" available from the trigger. The action is actually using the order attached to the metafield owner, which might be a bug, because I don't think that owner is actually an order in this case but a location.
Probably the path to the order is payment schedule / paymentTerms / order / id (click "Add a variable" to insert it).
I think your logic has issues as well but hopefully that helps you test a bit.
Thanks Paul, do you know how I would force the Send order invoice action to use the order from that path (payment schedule / paymentTerms / order / id)? At the moment it seems to be fixed on the For each loop and takes the information from that, and there's no way within the Send order invoice action to select the order path
This is an accepted solution.
I would remove that For-Each path entirely and instead just get each of the 3 metafield values directly (no looping). Choose "metafield (requires arguments)" instead of metafields.
You cannot currently force an action to use a different ID as it's auto-assigned. But changing that data is has access to should work
So I will remove the For each loop and just change it to Check if metafields key is email1 like this, and now the Send order invoice window looks like this. Do you think that will work now?
I think so, although I can't tell what's in that email liquid string
As in within the custom message?
no the recipient email address.
It's {{paymentSchedule.paymentTerms.order.purchasingEntity.PurchasingCompany.location.invoiceRecipient1.value}}
I have 3 Company location metafields, which are used to capture additional email addresses to send emails to my customers
Also, I am using the metafields (non-argument) variable as I only need to send to extra_invoice_recipient.email1 which I think the below achieves
That condition just checks if that key exists in the list of metafields. It doesn't select it for subsequent actions. I'd expect that it's always true, unless you have locations that do not have an email1. But the liquid you posted previously looks correct.
Thank you so much Paul. Really appreciate all your help
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024