Editing an Email Template using Code View

New Member

Editing an Email Template using Code View

I would like to insert a dynamic html <img> tag in my 'Email Template' using 'Code View'.

Is there a way to set the value of the 'img src' with the text value that is stored in Contact Custom Text 1?

Say for example the value of Contact Custom Text 1 = 'http://dyyo.com/img/analysis_registration.gif';


CTCT Employee

Re: Editing an Email Template using Code View

You can do this using custom fields. This must be done in an XHTML email (as opposed to HTML). The easiest way to do this would be to string a few custom fields together that will create he full image tag, for example:


Custom Field 1: 

<img src="


Custom Field 2:



Custom Field 3:



Then you would string these together in your XHTML email on one line such as:

<Property name="Subscriber.CustomText1" /><Property name="Subscriber.CustomText2" /><Property name="Subscriber.CustomText3" />


Once you have sent the email, all of these custom fields will be turned into their values for that particular contact, thus creating your dynamic image. You can find more information about inserting custom details into an XHTML email in this faq. I hope this helps. Please let us know if you have any further questions. Thank you.

David J

New Member

Re: Editing an Email Template using Code View

Hi David,

Thanks for the reply! This would definitely work!



Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More