mailui.init({
mergeTags: {
first_name: {
label: "First Name",
value: "{{first_name}}",
},
last_name: {
label: "Last Name",
value: "{{last_name}}",
}
}
});
mailui.setMergeTags({
first_name: {
label: "First Name",
value: "{{first_name}}",
},
last_name: {
label: "Last Name",
value: "{{last_name}}",
}
});
mailui.init({
mergeTags: {
user: {
label: "User Info.",
mergeTags: {
first_name: {
label: "First Name",
value: "{{user.first_name}}"
},
last_name: {
label: "Last Name",
value: "{{user.last_name}}"
},
}
}
}
});
mailui.init({
mergeTags: {
products: {
label: "Products",
rules: {
latestProducts: {
label: "Latest Products",
before: "{{#latest_products}}",
after: "{{/latest_products}}",
},
bestSallersProducts: {
label: "Best Sellers Products",
before: "{{#best_sallers_products}}",
after: "{{/best_sallers_products}}",
},
},
mergeTags: {
name: {
label: "Product Name",
value: "{{ name }}",
},
price: {
label: "Product Price",
value: "{{ price }}",
},
},
}
});
mailui.exportZip(function (data) {
const json = data.json;
console.log(json);
},
{
mergeTags: {
first_name: "John",
last_name: "Author",
}
});
mailui.exportZip(function (data) {
const json = data.json;
console.log(json);
},
{
mergeTags: {
latest_products: [
{name: "Product 1", price: "$24.99"},
{name: "Product 2", price: "$24.99"},
],
best_sallers_products: [
{name: "Product 1", price: "$24.99"},
{name: "Product 2", price: "$24.99"},
],
}
});