This has been implemented in WHMCS 7.5. You can learn more about it here: https://docs.whmcs.com/Marketing_Emails_Automation#Opt-In.2FOpt-Out_during_Registration.2FCheckout