Expand reusable email section presets
This commit is contained in:
1 parent
01abe351e9
commit
645914955c
2 files changed
+10
-2
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/email-renderer",
|
"name": "@wrnexus/email-renderer",
|
||||||
"version": "0.1.46",
|
"version": "0.1.47",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "WRNexus block email renderers with HTML, text, AMP Email, and MJML interoperability.",
|
"description": "WRNexus block email renderers with HTML, text, AMP Email, and MJML interoperability.",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -43,6 +43,14 @@ export function createSectionPreset(name: string, id: () => string): BlockNode {
|
|||||||
text("{{organizationAddress|Add your organization address}}"),
|
text("{{organizationAddress|Add your organization address}}"),
|
||||||
button("Unsubscribe", "{{unsubscribeUrl|https://example.com/unsubscribe}}"),
|
button("Unsubscribe", "{{unsubscribeUrl|https://example.com/unsubscribe}}"),
|
||||||
];
|
];
|
||||||
|
else if (name === "announcement")
|
||||||
|
content = [heading("Big news, just for you"), text("Share your latest launch, update, or upcoming event with your community."), button("See what’s new", "https://example.com")];
|
||||||
|
else if (name === "testimonial")
|
||||||
|
content = [heading("What our customers say"), text("“A thoughtful experience from start to finish. We couldn’t be happier.”"), text("— Customer name, Company")];
|
||||||
|
else if (name === "two-column") {
|
||||||
|
const columns = ["First highlight", "Second highlight"].map(title => node("layout.column", { width: "50%" }, { content: [heading(title), text("Describe a benefit, share an update, or introduce a service."), button("Learn more", "https://example.com")] }));
|
||||||
|
return node("layout.section", { background: "#ffffff", padding: "24px" }, { content: [node("layout.columns", {}, { columns })] });
|
||||||
|
}
|
||||||
else throw new Error("Unknown section preset.");
|
else throw new Error("Unknown section preset.");
|
||||||
const column = node("layout.column", { width: "100%" }, { content });
|
const column = node("layout.column", { width: "100%" }, { content });
|
||||||
const columns = node("layout.columns", {}, { columns: [column] });
|
const columns = node("layout.columns", {}, { columns: [column] });
|
||||||
@@ -50,7 +58,7 @@ export function createSectionPreset(name: string, id: () => string): BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Native, editable section presets; no HTML snapshots. */
|
/** Native, editable section presets; no HTML snapshots. */
|
||||||
export const emailPresets = ["welcome", "feature", "footer"].map(id => ({
|
export const emailPresets = ["welcome", "feature", "announcement", "testimonial", "two-column", "footer"].map(id => ({
|
||||||
id,
|
id,
|
||||||
name: { key: "email.presets." + id, fallback: id[0].toUpperCase() + id.slice(1) },
|
name: { key: "email.presets." + id, fallback: id[0].toUpperCase() + id.slice(1) },
|
||||||
icon: "icon-[lucide--layout-template]",
|
icon: "icon-[lucide--layout-template]",
|
||||||
|
|||||||
Reference in new issue
Block a user