Most companies send out marketing emails to their customers and prospects, and need a way to let them unsubscribe from your email messages. This Apex code will to process unsubscribe requests from the email recipients, and update the email opt-out flag
Unsubscribe opt-out