Email Opt-in discount without leaving site?

5 0 1

We are trying to work through a process where we offer a discount when someone signs up for our email newsletter. We are planning on using single opt in for the email form. We would love to be able to activate a discount once they complete that form. For example, they enter their email and submit and this enables a 50% discount on their order. Ideally we would like it timed, but without is fine. We are just trying to avoid them having to leave our site to go copy a coupon code from their email. If we can keep them on our site that would be ideal.

Is there an app or another way to accomplish this without custom coding?