This page provides you with information on how to identify and update the existing blocks and variables of a VCE template, also called block-based email template.
Important:
- Changing a template initially created by Emarsys is at your own risk.
- Before editing a VCE template it is highly recommended to create a backup copy of the modified content at a secure location.
Determining the base template of an email campaign
To open your existing email campaign and identify which VCE template is used as the basis of the campaign:
- Go to Channels > Email Campaigns, select the email campaign and click the Edit (pencil) icon.
- In the Content Creation page, click the three dots (...) icon in the upper right corner.
- Check the name of the VCE template that is used as the basis of your campaign.
Use the Account switcher if the template for the email campaign is on a different account.
How to identify which block to modify
To find out which block of your template to change, just hover over the content blocks. The name of the block is visible in the appearing feature bar.
Modifying the contents of a template
1. You can open the template for editing in either of the following options:
- Option 1: Go to Channels > Email Campaigns, open your email campaign and in the Content Creation page click the three dots (...) icon and select Open template.
- Option 2: Go to Content > Block-Based Templates select the template and click the Edit (pencil) icon.
2. In the Blocks tab select the template block you would like to edit and click the Edit (pencil) icon to see its code.
Text: Modifying text in a block
In the block code select the position where you want to change or delete an existing text. You can also add a new text here.
For example: You can change the text from "Any Street 1" to "Any Place 1".
To insert a manual line break, use the <br>
tag. You can join <br>
tags to generate a paragraph or a larger spacing between text rows.
For example:
The result, as it is visible in the email campaign:
It is strongly not recommended to use the <br>
tags at the very beginning or at the end of a continuous text to generate additional spacing at the top or at the bottom, as these <br>
will not be displayed.
Links
Links: Modifying an existing link
In the code of the block search for the link you want to change.
Examples for code structures of existing links
In the code examples any additional HTML attributes, CSS styles, classes, e-editable, etc. are removed, except the href
attribute.
Text link or Call-to-action button:<a href=""><font>Lorem ipsum</font></a>
or
<a href="">Lorem ipsum</a>
Embedded linked image:
<a href=""><img border="0"></a>
It is advised adding the attribute border="0"
to the <img>
tag to prevent a border to appear around the image.
Generally, the value of the HTML attribute href
defines the target of the link. You can replace the existing value with any URL. Sometimes the value of the href
attribute is empty by default (href=""
).
Check if you want to apply additional attributes to the <a> tag.
Links: Adding a link within continuous text
You can add a new link reference in the continuous text of these templates:
- Email template created by Emarsys
- Custom template
Links: Adding a new text link to a template created by Emarsys
You can add a new link reference to a template created by Emarsys. For information on Emarsys templates, see Ordering an email template from Emarsys.
- Position the cursor in the continuous text where you want to insert a link.
- The link can be added directly within the continuous text in a block. Use the following code snippet to insert the text link:
<a href="">Lorem ipsum</a>
Example of the link inserted within continuous text:Lorem ipsum <a href="https://www.yoursite.com">dolor</a> sit amet
The value of the HTML attribute href
defines the target of the link. You can insert any URL as the value of the of the href
attribute. The text inside of the opened <a>
and closed </a>
tag is the link text that is displayed.
- Check if you want to apply additional attributes to the <a> tag.
Links: Styling the link - The class: la
The styles of a link are set via a class called la
in one of the surrounding <td>
, <font>
, or <span>
tags.
The class la
is usually followed by a number and sometimes a specific style where u = underlined, b = bold, i = italic, s = strikethrough. It can also be a combination, for example, la1bu
would be bold and underlined style.
Examples:<td class="lh la1"><font>Lorem ipsum <a href="https://www.yoursite.com">dolor</a> sit amet</font></td>
<td class="lh"><font class="la1u">Lorem ipsum <a href="https://www.yoursite.com">dolor</a> sit amet</font></td>
<td class="lh"><font><span class="la1b">Lorem ipsum <a href="https://www.yoursite.com">dolor</a> sit amet</span></font></td>
When looking at the template's style, you can see that there are specific styles applied to <a>
tags when using this class.
To keep these default styles for the link, you only need to add a link within the continuous text, e.g.:Lorem ipsum <a href="https://www.yoursite.com">dolor</a> sit amet
To change any styles for the newly embedded link that are different from the default, these styles need to be added inline with the CSS !important
property, for example:Lorem ipsum <a href="https://www.yoursite.com" style="color:#cf4b40 !important; font-weight:bold !important; text-decoration:none !important;">dolor</a> sit amet
Links: Adding a new text link to a custom template
You can add a new link reference to a block of your custom template.
- Position the cursor in the continuous text where you want to insert a link.
- The link can be added directly within the continuous text in a block. Use the following code snippet to insert the text link:
<a href="">Lorem ipsum</a>
Example of the link inserted within continuous text:Lorem ipsum <a href="https://www.yoursite.com">dolor</a> sit amet
The value of the HTML attribute href
defines the target of the link. You can replace the existing value with any URL. You can insert any URL as the value of the of the href
attribute. The text inside of the opened <a>
and closed </a>
tag is the link text that is displayed.
- The styles of a link can either be set via inline styles or via class.
Examples:- Use of inline styles:
<a href="https://www.yoursite.com" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000; font-weight:normal; text-decoration:underline;">Lorem ipsum</a>
- Use of one or more CSS classes:
<a href="https://www.yoursite.com" class="link">Lorem ipsum</a>
Note that the CSS class needs to be defined in the template's style.
- Use of inline styles:
In some cases, it might be necessary to add the CSS !important
property to styles, in order for them to be applied.
- Check if you want to apply additional attributes to the <a> tag.
Links: Applying a link to an image
- Search for the
<img>
tag containing the image where you would like to apply a link.
Thesrc
attribute in the<img>
tag usually contains the image path. - Place the
<img>
inside an opened<a>
and a closed</a>
tag. - Add the URL to the
href
attribute.
Example:<a href="https://www.yoursite.com"><img></a>
- Check if you want to apply additional attributes to the <a> tag.
To make the link and the image editable when using the block in your e-mail campaigns, both tags need to get an e-editable
attribute. Both e-editable
need to be unique for the whole block, unless you would like the same link or image to be applied to other items, too. For more information, see Editable content - the e-editable attribute.
It is recommended adding the attribute border="0"
to the <img>
tag to prevent a border to appear around the image.
Example
In this example, no additional attributes or styles or classes, except the ones mentioned above, are applied to the <a>
and the <img>
tag.
<a e-editable="url_1" href="https://www.yoursite.com"><img e-editable="image_1" src="https://www.yoursite.com/img/image.png" border="0"></a>
Attributes: Additional attributes for links
You can add the following attributes to existing link references:
- HTML attributes available for the <a> tag
- Emarsys-specific attributes
HTML attributes for the <a> tag
Target attribute
The target
attribute can be used to either open a link in the actual browser window or in a new window or tab.
- Open the link in a new window or tab:
target="_blank"
- Open the link in the same window or tab:
target="_self"
In email, it is advised setting the attribute target="_blank"
, except for mailto:
links.
Examples
<a href="https://www.yoursite.com" target="_blank">Website</a>
<a href="mailto:user@yoursite.com" target="_self">user@yoursite.com</a>
Title attribute
The title
attribute adds an info text that appears when the link is hovered over.
Example
<a href="https://www.yoursite.com" title="Lorem ipsum">Website</a>
Emarsys-specific attributes
ems:notrack="true"
The ems:notrack="true"
attribute prevents a URL to be changed into a tracked link. It can be utilised if the link text is a URL.
Example<a href="https://www.yoursite.com" ems:notrack="true">www.yoursite.com</a>
ems:deeplink="true"
The ems:deeplink="true"
attribute defines a link to be a deep link. It can be used to apply a link to a telephone number, or something else.
Example<a href="tel:0123456789" ems:deeplink="true">0123456789</a>
In case of a linked email address via mailto:
, it is not necessary to add the ems:notrack="true"
/ems:deeplink="true"
attributes to the <a>
tag.
Images
Images: Modifying an image
Search for the image you would like to change in the code. Images are usually embedded via an <img>
tag that has a src
attribute. The value of the src
attribute is the image path.
Example<img src="https://www.yoursite.com/img/image.png">
In templates created by Emarsys, the embedding of an image normally is as follows:<img src="{variables.imgpath}image.png">
In the code examples any additional HTML attributes, CSS styles, classes, e-editable, etc. are removed, except the src
attribute.
Media Database: Modifying an image
In templates created by Emarsys, the value of the variable imgpath
leads to a specific folder in the Media Database of your account, containing all the assets of your template. The variable imgpath
may also be available in a custom template which was created as a copy of an Emarsys-built VCE template.
By opening the Variables tab of your template you can see the value (=the folder path) of the variable imgpath
.
Example: The images used in the template are found in the folder "vce" in the Media Database.
It is not recommended the variable imgpath
to be changed. Note that the image path may lead to a Media Database folder in another account, which is not accessible.
Keeping the original image filename
Usually, when uploading an image into the Media Database, the file gets an internal file name.
For example: md_[Internal file ID].[File suffix]
,
e.g. md_123456.png
.
To avoid this to happen, you can disable this feature by ticking the following checkbox.
Click Options button, the three dots (...) in the Media Database and select Copy URL to see the full image path.
You can easily replace the existing value of the src
attribute in the <img>
tag to change the image.
In case of using an Emarsys-built template and you uploaded the new image to the template's asset folder ({variables.imgpath}
), you can replace the image by changing the file name in the image's src
attribute.
Check if you want to add additional attributes, styles to the <img> tag.
Additional attributes, styles for embedded images
Width, height attributes
You can set a specific width or height in pixel unit to an image via the HTML attributes width
and height
.
Note that the unit (px, etc.) must not be added to the value. If only one value (either the width or the height) is provided, the other value will be calculated automatically.
Examples
<img src="https://www.yoursite.com/img/image.png" width="200">
<img src="https://www.yoursite.com/img/image.png" height="150">
<img src="https://www.yoursite.com/img/image.png" width="200" height="150">
If you are using a template created by Emarsys, then you can also add the CSS class image
which will cause the image to be scaled to 100% of the available space in the mobile version:
<img src="https://www.yoursite.com/img/image.png" width="200" class="image">
The screen width of mobile devices is usually between 320 and 430px, so we recommend images that are of a width of 300px and up to get the class image
to scale properly in the mobile version.
Alt attribute
The alternative text of an image is usually displayed in these cases:
- The image content or external content has not been downloaded.
- The image path is broken or the image is not available.
Example<img src="https://www.yoursite.com/img/image.png" alt="Lorem ipsum">
The alternative text is not displayed in all email environments.
Border attribute
Normally, if an image is linked (an opened <a>
and closed </a>
tag is surrounding the <img>
tag), it is recommended to add the attribute border="0"
to the <img>
tag to prevent a border to appear around the image.
Example<img src="https://www.yoursite.com/img/image.png" border="0">
Display:block style
As long as an image is not embedded as an inline item, it is advised to apply the style display:block
by default. This style prevents padding to appear at the top and at the bottom of an image in some email environments.
Example<img src="https://www.yoursite.com/img/image.png" style="display:block;">
Variables
Variables: Modifying variables of a template
A variable can be used more than once in a template. For example, you can use variables in the Frame, Style or in blocks. So, editing a variable may not affect only a specific part, but other contents, too.
In some cases, it is necessary to create a copy of the variable in order to be changeable independently. For more information, see Setting-up-template-variables.
Variables can be used in the template's Frame, Style or in blocks and are embedded like this:{variables.variableName}
Check the embedding of the variables you would like to change to see which values can be used: string, color code, integer, etc.
- Select the Variables tab and search for the variable you would like to edit.
- Click Edit to change the type or the values.
Saving the template changes and updating existing campaigns
- Save the email template changes when you finished editing it.
- Update existing email campaigns for the changes to take effect.
For more information regarding updating your existing campaigns, see:
Modifying email templates - FAQ
An existing email campaign has been updated with template changes and saved. Why are the changes not visible?
- Make sure your email campaign is based on the template you edited.
- The email campaign may not have been updated properly. After applying an update, the campaign needs to be saved.
- Once you edit a content item (text, image, link) or a variable in your campaign, so it differs from the default content or value, this item keeps the changes made, even if you apply a campaign update.
- To see the changes, it is necessary to reset the block or the variables.
Resetting a block will change all the content back to the default values of text, links, images.
Instead of resetting the block, you can drag&drop a new block into your campaign to replace the existing one.
Template variables are not automatically reset via the Reset block button. They can be reset to their default value either via Block Style Settings on block level, or globally via Campaign Style Settings. For example, if a variable is used in the template's Frame only.
Reset via Block Style Settings.
Reset via Campaign Style Settings.
Settings applied via Campaign Style Settings can be overridden by the same settings done on block level, so it might be necessary to reset the variables with both options shown.