%%[VAR @SFContactId, @phone, @cmStatus SET @SFContactId = SFContactId SET @phone = MobileNumber SET @cmStatus = 'Start' IF NOT EMPTY(@SFContactId) AND @SFContactId != '' THEN VAR @campaignMemberID SET @campaignMemberID = Lookup('CampaignMember_Salesforce','Id','ContactId', @SFContactId, 'CampaignId', '7010N000000H4W4QAK') IF NOT EMPTY(@campaignMemberID) THEN SET @cmStatus = 'Update op CampaignMemberID' UpdateSingleSalesforceObject('CampaignMember', @campaignMemberID, 'soco__Status_opt_in__c', 'false', 'soco__Date_opt_out__c',Format(Now(),'yyyy-mm-dd')) InsertData('SMS_Optin', 'SubscriberKey',@SFContactId,'Mobile',@phone,'Optin','False','Opt-out Date',Now(),'Status',@cmStatus) ELSE SET @cmStatus = 'Wel ContactID maar geen CampaignMemberID' InsertData('SMS_Optin', 'SubscriberKey',@SFContactId,'Mobile',@phone,'Optin','False','Opt-out Date',Now(),'Status',@cmStatus) ENDIF ELSE SET @cmStatus = 'Geen SF ContactID' InsertData('SMS_Optin','SubscriberKey',@phone,'Mobile',@phone,'Optin','False','Opt-out Date',Now(),'Status',@cmStatus) ENDIF ]%% Campaignmember status: %%=v(@cmStatus)=%% Campaignmember ID: %%=v(@campaignMemberID)=%%