Replace strings

Maizzle can batch-replace strings in your HTML email template, and you can even use regular expressions!

Usage

Use the replaceStrings option to define key-value pairs of regular expressions and strings to replace them with:

config.js
module.exports = {
replaceStrings: {
'find and replace this exact string': 'with this one',
'\\s?data-src=""': '', // remove empty data-src="" attributes
}
}

API

app.js
const {replaceStrings} = require('@maizzle/framework')
const html = await replaceStrings('initial text', {initial: 'updated'})
Copyright © 2024 Maizzle SRLBrand policy
Edit this page on GitHub