docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Build a programmatic email template generator that creates MJML templates using JSON objects instead of XML strings. The generator should construct a complete responsive email template with a header, content sections, and footer.
Create a function generateEmailTemplate(data) that:
html and any errors from compilationThe email should have this structure:
/**
* Generates an email template from data using MJML JSON format
* @param {Object} data - Email content data
* @param {string} data.heading - Main heading text
* @param {string} data.message - Body message text
* @param {string} data.buttonText - CTA button text
* @param {string} data.buttonUrl - CTA button URL
* @param {string} data.footerText - Footer text
* @returns {Object} Result object with html and errors properties
*/
function generateEmailTemplate(data) {
// Implementation here
}
module.exports = { generateEmailTemplate };Provides MJML to HTML compilation with JSON input support.