Building templates for a client in CONTENT BUILDER and we're using AMPscript at the top so a non-HTML user can insert the content they want to populate in the email.
Everything works great, until the customer wants to include a URL in the copy, as the SET statements get messy since the quotes in the a href close the SET statement.
We've tried using TreatAsContent, but did not have much luck as we couldn't get the URLs to get tracked. Here are a few things we tried.
SET @sub_trailer = "Lean more by clicking <a href="http://www.google.com">here</a>"
The above results in the URL missing and the code breaking, since the SET statement ends after the href="
We also tried
SET @link = "http://www.google.com" SET @sub_trailer = "Learn more by clicking <a href="%%=RedirectTo(@link)=%%">here</a>
and that has the same issue as above.
We also tried the above and in the email itself using
%%=TreatAsContent(@sub_trailer)=%% using the escape codes for the quotation marks
SET @sub_trailer = "Learn more by clicking <a href=%22%%=RedirectTo(@link)=%%%22>here</a>, and while the content appears, the link doesn't track and it becomes "http://www.google.com" instead of just http:// and obviously it's not tracked.
We ended up simply pasting over the AMPscript displayed in the email (where %%=v(@sub_trailer)=%% appears)