Thank you for reaching out with your question! You can manage this process via marketing apps such as Klaviyo and Omnisend, which allow you to send marketing correspondence to customers who have signed up on your store. A sign-up discount code can be included in these emails. These apps can also be used to gather these emails initially via the creation of pop-ups and sign-up forms, although this can also be done through the Shopify admin and theme.
I hope this explains things but please let me know if you have more questions.
Victor | Shopify Social Care
you can use app Auto Discount: Welcome Voucher, where you can set creating a discount code for customers who sign up (register) to your store. Discount code will be send automatically to customer who register by email. You can also set in app configuration when discount expire after this discount is generated and much more.