docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Build a function that compiles MJML email templates using a custom HTML document structure. The custom structure should add specific meta tags and tracking elements that are not present in the default MJML output.
Your function should:
<meta name="viewport" content="width=device-width, initial-scale=1.0"><img src="https://track.example.com/pixel.gif" width="1" height="1" />og:title and og:type set to "email"lang) and text direction (dir) attributes from the MJML inputCompiles a basic MJML template with the custom viewport meta tag @test
Includes the tracking pixel image before the email content @test
Adds Open Graph meta tags to the document head @test
/**
* Compiles MJML templates with a custom HTML document structure.
*
* @param {string} mjmlTemplate - The MJML template string to compile
* @returns {Object} Object containing the compiled HTML string in the 'html' property
*/
function compileWithCustomStructure(mjmlTemplate) {
// IMPLEMENTATION HERE
}
module.exports = {
compileWithCustomStructure
};Provides MJML to HTML compilation support.