We are sending messages to Customers from Salesforce Service by calling marketing cloud Transactional API. We are using Marketing cloud only as gateway and, templates for SMSes and Emails, are all sent as content in the API call payload. Once the message is sent, we write the logs in the Log object in Service cloud with messagekey, status etc.
We want to implement an opt-in and opt-out flow for SMSes messages so that clients can opt-out and also see STATUS "Opt-out" in the Log object for passengers that has opted out(if the message was undelivered because of opt out status). What could be the best possible approach to implement this scenario.