SOLVED

How do I use an image for the Default content in a token?

Go to solution
Guitarrista82
Level 6

Hello Community,

 

We want to use an image as the default content for an image token we've created. Is this possible to do?

 

I tried simply pasting the image link as shown below, but the image doesn't appear when previewing the email in default mode:

Guitarrista82_0-1686676448060.png

 

default image.png

 

Thank you,

LK

 

1 ACCEPTED SOLUTION
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Well, you can output the plain image URL from the velocity script token in the already existing image tag of your editable module, or you can also copy over the styles from here to the image tag in the velocity script token (in this case, you'd have to remove the already existing image tag in your editable module, as it's gonna be part of the velocity script). It's up to you how you want to do it. For the former case (i.e., just output the image URL from the velocity token), your script would look like something below. Add this velocity my token in the src attribute of the image tag in the editable module in the email and you should be good. Looking at your use-case you're better off with approach 1, i.e., outputting the image URL from the velocity token and plugging the token in the src attribute as I discussed above.

 

#if(!$lead.DestinationImageLink.isEmpty())
#set($imageURL = $lead.DestinationImageLink)
#else
#set($imageURL = "https://cdn3.redweek.com/photos/full/3/6/4/364719.jpg?1")
#end
${imageURL}

 

 

View solution in original post

15 REPLIES 15