A sample Salesforce Marketing Cloud Content Builder block built with the blocksdk, deployable via Live Server, Node.js, or Docker for integration testing.
git clone https://github.com/barcellos-pedro/custom-block-widget-sample.gitThis skill provides a sample implementation of a custom block for Salesforce Marketing Cloud Content Builder using the blocksdk. It demonstrates how to build, deploy, and integrate custom blocks into Marketing Cloud's content creation workflow. The project supports multiple deployment methods including Live Server, Node.js, and Docker containerization, making it suitable for development and testing environments. Teams working with Marketing Cloud can use this as a reference implementation to understand block structure, deployment options, and integration with blocktester for validation.
Deploy the project using one of three methods: Live Server (VS Code extension), Node.js (npm install && npm start), or Docker (docker build and docker run). Use the resulting localhost URL or the hosted app URL (https://custom-block-widget-sample.herokuapp.com/) in the blocktester widget URL field to test integration.
Test custom Marketing Cloud blocks using blocktester
Deploy a sample Content Builder block to a local development environment
Containerize and run a Marketing Cloud block widget in Docker
Integrate a custom block into Salesforce Marketing Cloud workflows
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/barcellos-pedro/custom-block-widget-sampleCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Create a custom block widget for Salesforce Marketing Cloud Content Builder. The widget should be named '[WIDGET_NAME]' and be designed for the [INDUSTRY] industry. The widget should include [FEATURE_1], [FEATURE_2], and [FEATURE_3]. Provide the HTML, CSS, and JavaScript code for the widget, along with a brief description of how it can be used.
## Custom Block Widget: Product Recommendation Engine
### Description
The Product Recommendation Engine is a custom block widget designed for the e-commerce industry. This widget dynamically displays product recommendations based on the user's browsing history and purchase behavior. It includes the following features:
- **Personalized Recommendations**: Displays products tailored to the user's interests.
- **Real-time Updates**: Updates the recommendations in real-time as the user interacts with the site.
- **Responsive Design**: Adapts to different screen sizes and devices.
### HTML Code
```html
<div class="product-recommendation-engine">
<!-- Recommendation content will be dynamically inserted here -->
</div>
```
### CSS Code
```css
.product-recommendation-engine {
border: 1px solid #ddd;
padding: 20px;
border-radius: 5px;
background-color: #f9f9f9;
}
.product-recommendation-engine h2 {
color: #333;
font-size: 18px;
margin-bottom: 15px;
}
```
### JavaScript Code
```javascript
document.addEventListener('DOMContentLoaded', function() {
// Fetch user data and product recommendations
fetch('/api/recommendations')
.then(response => response.json())
.then(data => {
const recommendationContainer = document.querySelector('.product-recommendation-engine');
data.recommendations.forEach(product => {
const productElement = document.createElement('div');
productElement.innerHTML = `
<h3>${product.name}</h3>
<p>${product.description}</p>
<p>Price: $${product.price}</p>
`;
recommendationContainer.appendChild(productElement);
});
});
});
```Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan