We are currently in the process of trying to bring CMS content in our marketing cloud emails. I have ran in a bit of an issue when I am trying to bring in the pictures.

In a stripped down example of the XML:

            <Image Name="route_map" Caption="route_map" Width="297" Height="297" Type="map" Url="https://www.insightvacations.com/-/media/images/maps/iv/2019/europe-2019/romanticeuropeanlonlon_e912b_summer2019_ww.jpg?mw=297&amp;mh=297&amp;bc=white" />
            <Image Name="route_map" Caption="route_map" Width="600" Height="600" Type="map" Url="https://www.insightvacations.com/-/media/images/maps/iv/2019/europe-2019/romanticeuropeanlonlon_e912b_summer2019_ww.jpg" />
            <Image Name="primary_image" Caption="primary_image" Width="125" Height="125" Type="photo" Url="https://www.insightvacations.com/-/media/images/imageupload/tour-images/e912b_125x125_001.jpg" />
            <Image Name="primary_image" Caption="primary_image" Width="531" Height="531" Type="photo" Url="https://www.insightvacations.com/-/media/images/imageupload/tour-images/e912b_531x531_001.jpg" />
            <Image Name="primary_image" Caption="primary_image" Width="1920" Height="660" Type="photo" Url="https://www.insightvacations.com/-/media/images/imageupload/tour-images/e912b_1920x660_001.jpg" />

I don't know how to write the BuildRowsetFromXML syntax to get the picture with the following properties Width="1920" Height="660". I need the URL so i can then use the treatascontent with HTTP get.

Any guidance is appreciated.



I realised what I need to do. I wrote the following code:

%%[SET @imagesBannerNode=BuildRowsetFromXML(@xmlData,'/TourInfo/Assets/Images/Image',1)
SET @imageBannerURL=Field(Row(@imagesBannerNode,5), 'Url_att')
SET @imageMapURL=Field(Row(@imagesBannerNode,2), 'Url_att')
SET @mapPic=TreatAsContent(HTTPGet(@imageMapURL))
SET @mapBanner=TreatAsContent(HTTPGet(@imageBannerURL))]%%
Image Map:

    <img src="%%=v(@mapPic)=%%">
Banner Image 

    <img src="%%=v(@mapBanner)=%%">

I am running into a different issue; my HTTPGET returns a string of broken characters and I assume that is because the picture is HTTPs in the XML.

Any ideas how to overcome this?


| improve this answer | |
  • i managed to solve this by entering in the src the variables that pull the URL so I have skipped the TreatAsContent and HTTPGET altogether – Giulietta Feb 21 '19 at 9:30

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.