Introduction
Migrating content from one ESP to another can be a daunting task, especially when dealing with large content libraries and different templating syntaxes. In this project, we automated the migration of HTML content from Responsys to Adobe Campaign using Python, ensuring all syntax conversions were handled efficiently while also creating an archive for historical reference.
Step 1: Extracting Content from Responsys
The first step in the migration process was to extract all email HTML content from Responsys’s Content Library. Our team pulled all relevant assets and stored them in a structured format to facilitate processing.
Step 2: Syntax Conversion with Python
Responsys uses a different personalization syntax than Adobe Campaign. To ensure emails function correctly after migration, we created a Python script to bulk replace Responsys-specific variables with Adobe’s equivalent.
For example:
import re
def convert_syntax(content):
replacements = {
r'\${FIRST_NAME}': '<%= targetData.first_name %>',
r'\${LAST_NAME}': '<%= targetData.last_name %>'
}
for old_syntax, new_syntax in replacements.items():
content = re.sub(old_syntax, new_syntax, content)
return content
This script processed all HTML files and applied the necessary conversions.
Step 3: Creating an Offline Archive
To maintain a reference to the Responsys content and assist with validation, we structured the content into an offline archive with a simple navigational interface. This included:
index.html
: A single HTML file containing embedded CSS and JavaScript for a self-contained archive.generateDirectoryStructure.js
: A script to scan the content directory and generate a JSON representation of the file structure.DirectoryStructure.json
: The generated file containing the directory layout, which helps render the archive navigation dynamically.
Here’s an example of the directory structure script:
const fs = require('fs');
const path = require('path');
function generateDirectoryStructure(dir, fileList = []) {
fs.readdirSync(dir).forEach(file => {
const filePath = path.join(dir, file);
if (fs.statSync(filePath).isDirectory()) {
generateDirectoryStructure(filePath, fileList);
} else {
fileList.push(filePath);
}
});
return fileList;
}
const directoryStructure = generateDirectoryStructure("./offline-content");
fs.writeFileSync("DirectoryStructure.json", JSON.stringify(directoryStructure, null, 2));
After running this script, we manually removed system-specific paths before using the JSON file in our archive viewer.
Step 4: Importing into Adobe Campaign
With the content properly formatted and stored, we created an Adobe Campaign Workflow to systematically import the migrated files into Personalization Blocks and Delivery Templates, ensuring a seamless transition.
Conclusion
By leveraging Python and JavaScript, we streamlined the migration of Responsys content to Adobe Campaign while preserving historical data for reference. This approach not only automated syntax conversion but also provided an easy-to-navigate archive, reducing the time spent searching for past content and ensuring consistency in the new ESP.