How to send plugin unlock codes upon purchase from Shopify store?

I’m trying to set up a Shopify online store to sell plugins. I’m using a bare-minimum copy protection scheme where there’s a free demo version that users can unlock with a code purchased from my online store, without requiring re-download. I’m going serverless, i.e. the plugins don’t have any ability to make a call to home. This is because I never want users to have their creative sessions interrupted by client/server connectivity issues with my software.

The unlocking code will be a function of the user’s email address, so that pirating a plugin requires users to share an unlock code AND the associated email address, which is slightly more inconvenient than just having to share a code (even if only cosmetically).

I’m stuggling to figure out how to generate and send the unlocking code at the point of sale, i.e. in the Shopify confirmation email or similar. I’ve found several existing solutions using WooCommerce (not my preferred platform) or using pre-generated codes (doesn’t work for me because I can’t generate my codes before knowing the user’s email address) or that generate a random code at the point of sale (doesn’t work for me because it’s random and not my proprietary algorithm).

Has anybody figured out how to do this? Shopify customer support told me I need to write my own custom Shopify app… seems like a heavy lift!