-2

We have a requirement - when we click on a button, it should redirect to particular contentblock. I have tried multiple ways like <a href="%%=ContentBlockByKey(@contentBlockKey)=%%">click here</a> <a href="RedirectTo(%%=ContentBlockByKey(@contentBlockKey)=%%)">click here</a>.

But no luck. This block contains the unsubscribe page. I believe the cloud page will be the right option. However, I would like to explore this contentblock approach as well

1
  • You can’t link to a content block like this, since it doesn’t have its own url. I would recommend utilising the RedirectTo function along with CloudPagesUrl, to pass your subscriber attributes to your unsubscribe page Jun 20 at 16:33

1 Answer 1

-1

In your content block that you are setting your Unsubscribe page you can set variables in two ways:

SET @unsubscribeURLOption = https://example.com/unsubscribe/ (if you don't need to pass any SFMC email values to the cloud page.) Preferred would be: SET @unsubscribeURLOption2 = CloudPagesURL(#)

In your email content call the contentblockbykey (or ID) at the top of the block that has the link: %%[ contentBlockByKey("contentblockname") ]%%

Your href then calls the value: href="%%=reDirectTo(@unsubscribeURLOption)=%%"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.