How to create affiliate coupon codes upon registration of new user

I want to offer my customers a coupon code that they receive upon paid registration and can give out to other people so that my customers can refer other customers and receive a part of every sale made with their coupon code. Is there a way to do this rather than manually entering each newly registered customer as an affiliate manually. Manual entry would be very tedious, time consuming, and not provide the code to the customer immediately upon registration. Thanks.

Use some affiliate plugin - s2M is not designed to that, it cares about member’s access, levels, custom fielfs etc.