2

I'm trying to store as much information as I can outside of an Excel Spreadsheet and feel like I can import it into my emails using External Blocks.

I have one External Block pulling in AMPSript variables and its values like the URL, color for the titles, and image source from a webpage. I have a second External Block pulling in AMPSript variables and its values that are complete HTML blocks with the first AMPScript's variables nested inside.

The problem is the HTML Blocks are being rendered but the nested AMPScript are not. Is there a way to for Content Builder to interpret the variable nested inside the HTML after it runs and gets the 'webpage'?

Example of AMPScript I'm pulling in:

VAR @url, @featureTitle, ...

SET @url = "www.example.com"
SET @featureTitle = "Amazing Story"
SET ...

Example of the variable that has AMPScrip within the HTML block:

VAR @featureImageArea

SET @featureImageArea =
'<table>
  <tr>
    <td>
      <table>
        <tr>
          <td align="center">
            <a href="%%= v(@url) =%%/%%articleID%%" title="%%featureTitle%%" alias="%%featureTitle%%" conversion="false" data-linkto="other">
              <img src="http://image.url.jpg" alt="%%aAlt%%" height="auto" width="100%" style="display: block; height: auto; width: 100%; padding: 0px; text-align: center;">
            </a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>'

Bussines workflow wise, this is something I think will greatly improve the way we build emails. Any information will help.

3

You can use the TreatAsContent() function to achieve this

Try adding

SET @featureImageArea = TreatAsContent(@featureImageArea)

After your code

| improve this answer | |
1

You could alternatively create a Content Box and save it with an external key e.g. FeatureImageArea

Save your html into the content box.

Then use the ampscript to get the content block e.g.

%%[ set @FeatureImageArea = ContentBlockbyKey("FeatureImageArea") ]%%

The benefit to this is that your html is neatly stored as a reusable component, and if you want to change the html you don't have to worry about amending you email or your ampscript variables

| improve this answer | |

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.