The short answer is that you can't. But there's a workaround.
Let's say you have a newsletter design as follows, which shows the post image
, followed by its title
and full content
.
*|RSSITEM:IMAGE|*
*|RSSITEM:TITLE|*
*|RSSITEM:CONTENT_FULL|*
The *|RSSITEM:IMAGE|*
RSS merge tag will pull in the image and assign to the created img
element the width
and height
corresponding to the original size of the image. Something like this (which is an example extracted from my Mailchimp campaign using the design template above).
<img
class="mc-rss-item-img"
src="https://nono.ma/img/u/sketch-170202_cambridge-clary-st.jpg"
height="1868"
width="2500"
style="height: 1868;width: 2500;"
>
The problem is that we don't want to explicitly specify the height
and width
values of our image, as it's oversized compared to the width of our design, which in my example was 600px
plus margins, which was leaving 564px
for the width of the image itself.
Here's the workaround: You create the image's img
HTML element yourself, formatting it as you want, and use the RSSITEM:ENCLOSURE_URL
—which according to Mailchimp "Displays the URL for the attached file [of your post]." In my case, the RSS feed is using the enclosure
tag to send the image URL.
// RSS feed item enclosure tag
<enclosure
url="https://nono.ma/img/u/sketch-170202_cambridge-clary-st.jpg"
type="image/jpeg"
/>
Then I can use that URL in my Mailchimp design as follows (also adding the post's title
and full content
below the image
).
<img
src="*|RSSITEM:ENCLOSURE_URL|*"
style="max-width: 100%"
>
*|RSSITEM:TITLE|*
*|RSSITEM:CONTENT_FULL|*