Email Subscriber Loyalty Discount

Hi there, I’m looking for a way to offer a % discount code to all customers who have subscribed to my email newsletter, which remains active while they remain subscribed. So they always get the discount as long as they remain subscribed, for all purchases rather than as a one-off purchase. How would I do that?