We need to allow people to unsubscribe from an SMS that is sent through Journey Builder. We bring them to a Cloud Page where they confirm they want to unsubscribe. We also need to unsubscribe them from SF and hence in MC.
I am trying with this formula within the SMS and I didn´t even receive the message.
%%[
var @Id, @shortenUrl, @bitlyUrl, @link, @PhoneNumber
set @Id = RequestParameter('Id')
set @Id = RequestParameter('PhoneNumber')
set @link = URLEncode(CloudPagesURL(434,'Id',@Id,'PhoneNumber', ))
set @bitlyUrl = 'bitly_link'
set @shortenUrl = HTTPGet(Concat(@bitlyUrl,@link,"&format=txt"))
]%%
Code in the Confirmation Cloud Page:
%%[
SET @Phone= RequestParameter("PhoneNumber")
SET @Id= RequestParameter("Id")
]%%
Code in the processing page to update field in SF:
%%[
SET @Phone=RequestParameter('PhoneNumber')
SET @Id=RequestParameter('id')
SET @Baja=Lookup('DE_Baja_SMS','Baja','Id',@Id)
SET @FDC=UpdateSingleSalesforceObject('Contact', @Id, 's360a__CommunicateViaSMS__c', @Baja) ]%%
set @link = URLEncode(CloudPagesURL(434,'Id',@Id,'PhoneNumber', ))
. There's an extra comma.RequestParameter()
to retrieve theId
andPhoneNumber
from the send context?