You can offer discount codes to your subscribers for upcoming promotions or an ongoing promotion through one of these ways.
Option 1) Autoresponder
You can create an Autoresponder email and add the code in the content of that email. So when someone subscribes to your form, this autoresponder will be triggered and the subscriber will receive the code in their inbox.
Option 2) Form Thank You Message
You can add the coupon code in the success message for the form. Upon subscription the code will be revealed to the subscriber in the success message.
Real time generated codes cannot be added to the form or the Autoresponder email. This code needs to be added manually and needs to be a static code.
If you are displaying the code in the success message for the form, then make sure that you do no have a redirect URL added in the Behavior step for the form.