Automatic coupon codes question


I am creating a site where we are hoping to perhaps sell up to 50 licenses at once - say to a school or college. (this would be alongside individual memberships as well)

I am thinking I can do this via coupon codes, eg a school purchases 50 licenses and then a coupon code gets sent out with a limit of 50 uses.

Now, from what I can see with the coupon codes is that I have to manually set them up and then manually create a form that accept the codes.

What I would like to know is if it’s at all possible that for each time a purchase of 50 licenses is made whether a new coupon code can be automatically generated and that can be sent out in the confirmation email.

Any help or advice greatly appreciated.

Kind Regards