How can I automatically send unique access codes to customers after purchase?

Hi Everyone,

We are selling digital services and I would like to know how to set it up in Shopify whereby when a customer checks out the service and pays, they will receive a unique code which they can then use to register to another platform and access the service.

Note that the unique codes are already generated in that other platform, I just don’t know how I can link it whereby for every customer after they purchase, they will get that unique code automatically on their email.

Any advise / your expertise are highly appreciated.

Thanks,

Ruby