Skip to content

Commit 27fc676

Browse files
committed
Fighting nim v2 parsing
1 parent 8b94196 commit 27fc676

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

nimletter-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
postgres:
2727
condition: service_healthy
2828
environment:
29-
PG_HOST: localhost:5432
29+
PG_HOST: 127.0.0.1:5432
3030
PG_USER: postgres
3131
PG_PASSWORD: postgres
3232
PG_DATABASE: nimletter_db

nimletter.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "0.3.5"
3+
version = "0.3.6"
44
author = "ThomasTJdev"
55
description = "Newsletter"
66
license = "AGPL v3"

src/database/database_setup.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ proc databaseCreate*() =
4444
echo "Error executing SQL: " & sqlItem
4545
echo "Got this error code: " & getCurrentExceptionMsg()
4646

47-
exec(conn, sql("INSERT INTO mails (name, identifier, category, contentHTML, contentEditor, subject) VALUES (?, ?, ?, ?, ?, ?);"), "Double Opt-In", "double-opt-in", "template", "<div style=\"background-color:#F5F5F5;color:#262626;font-family:&quot;Helvetica Neue&quot;, &quot;Arial Nova&quot;, &quot;Nimbus Sans&quot;, Arial, sans-serif;font-size:16px;font-weight:400;letter-spacing:0.15008px;line-height:1.5;margin:0;padding:32px 0;min-height:100%;width:100%\"><table align=\"center\" width=\"100%\" style=\"margin:0 auto;max-width:600px;background-color:#FFFFFF\" role=\"presentation\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\"><tbody><tr style=\"width:100%\"><td><div style=\"padding:24px 32px 24px 32px\"><h2 style=\"font-weight:bold;margin:0;font-size:24px;padding:16px 24px 16px 24px\">Hi {{ firstname | there }}</h2><div style=\"font-weight:normal;padding:16px 24px 16px 24px\">We’re glad to have you with us at {{ pagename }}!</div><div style=\"font-weight:normal;padding:16px 24px 16px 24px\">To finish subscribing to our emails, just click the button below. You can unsubscribe anytime if you change your mind.</div><div style=\"text-align:center;padding:16px 24px 16px 24px\"><a href=\"{{ hostname }}/subscribe/optin?contactUUID={{ contactUUID }}\" style=\"color:#FFFFFF;font-size:16px;font-weight:bold;background-color:#4F46E5;border-radius:4px;display:block;padding:12px 20px;text-decoration:none\" target=\"_blank\"><span><!--[if mso]><i style=\"letter-spacing: 20px;mso-font-width:-100%;mso-text-raise:30\" hidden>&nbsp;</i><![endif]--></span><span>Subscribe!</span><span><!--[if mso]><i style=\"letter-spacing: 20px;mso-font-width:-100%\" hidden>&nbsp;</i><![endif]--></span></a></div></div></td></tr></tbody></table></div>", "{ \"root\": { \"type\": \"EmailLayout\", \"data\": { \"backdropColor\": \"#F5F5F5\", \"canvasColor\": \"#FFFFFF\", \"textColor\": \"#262626\", \"fontFamily\": \"MODERN_SANS\", \"childrenIds\": [ \"block-1737229372503\" ] } }, \"block-1737229372503\": { \"type\": \"Container\", \"data\": { \"style\": { \"padding\": { \"top\": 24, \"bottom\": 24, \"right\": 32, \"left\": 32 } }, \"props\": { \"childrenIds\": [ \"block-1737229386674\", \"block-1737229395871\", \"block-1737229536738\", \"block-1737229551815\" ] } } }, \"block-1737229386674\": { \"type\": \"Heading\", \"data\": { \"props\": { \"text\": \"Hi {{ firstname | there }}\" }, \"style\": { \"padding\": { \"top\": 16, \"bottom\": 16, \"right\": 24, \"left\": 24 } } } }, \"block-1737229395871\": { \"type\": \"Text\", \"data\": { \"style\": { \"fontWeight\": \"normal\", \"padding\": { \"top\": 16, \"bottom\": 16, \"right\": 24, \"left\": 24 } }, \"props\": { \"text\": \"We’re glad to have you with us at {{ pagename }}!\" } } }, \"block-1737229536738\": { \"type\": \"Text\", \"data\": { \"style\": { \"fontWeight\": \"normal\", \"padding\": { \"top\": 16, \"bottom\": 16, \"right\": 24, \"left\": 24 } }, \"props\": { \"text\": \"To finish subscribing to our emails, just click the button below. You can unsubscribe anytime if you change your mind.\" } } }, \"block-1737229551815\": { \"type\": \"Button\", \"data\": { \"style\": { \"fontWeight\": \"bold\", \"textAlign\": \"center\", \"padding\": { \"top\": 16, \"bottom\": 16, \"right\": 24, \"left\": 24 } }, \"props\": { \"buttonBackgroundColor\": \"#4F46E5\", \"fullWidth\": true, \"text\": \"Subscribe!\", \"url\": \"{{ hostname }}/subscribe/optin?contactUUID={{ contactUUID }}\" } } } }", "Confirm your email address")
47+
exec(conn, sql("INSERT INTO mails (name, identifier, category, contentHTML, contentEditor, subject) VALUES (?, ?, ?, ?, ?, ?);"), "Double Opt-In", "double-opt-in", "template", "<div style=\"background-color:#F5F5F5;color:#262626;font-family:&quot;Helvetica Neue&quot;, &quot;Arial Nova&quot;, &quot;Nimbus Sans&quot;, Arial, sans-serif;font-size:16px;font-weight:400;letter-spacing:0.15008px;line-height:1.5;margin:0;padding:32px 0;min-height:100%;width:100%\"><table align=\"center\" width=\"100%\" style=\"margin:0 auto;max-width:600px;background-color:#FFFFFF\" role=\"presentation\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\"><tbody><tr style=\"width:100%\"><td><div style=\"padding:24px 32px 24px 32px\"><h2 style=\"font-weight:bold;margin:0;font-size:24px;padding:16px 24px 16px 24px\">Hi {{ firstname | there }}</h2><div style=\"font-weight:normal;padding:16px 24px 16px 24px\">We're glad to have you with us at {{ pagename }}!</div><div style=\"font-weight:normal;padding:16px 24px 16px 24px\">To finish subscribing to our emails, just click the button below. You can unsubscribe anytime if you change your mind.</div><div style=\"text-align:center;padding:16px 24px 16px 24px\"><a href=\"{{ hostname }}/subscribe/optin?contactUUID={{ contactUUID }}\" style=\"color:#FFFFFF;font-size:16px;font-weight:bold;background-color:#4F46E5;border-radius:4px;display:block;padding:12px 20px;text-decoration:none\" target=\"_blank\"><span><!--[if mso]><i style=\"letter-spacing: 20px;mso-font-width:-100%;mso-text-raise:30\" hidden>&nbsp;</i><![endif]--></span><span>Subscribe!</span><span><!--[if mso]><i style=\"letter-spacing: 20px;mso-font-width:-100%\" hidden>&nbsp;</i><![endif]--></span></a></div></div></td></tr></tbody></table></div>", "{ \"root\": { \"type\": \"EmailLayout\", \"data\": { \"backdropColor\": \"#F5F5F5\", \"canvasColor\": \"#FFFFFF\", \"textColor\": \"#262626\", \"fontFamily\": \"MODERN_SANS\", \"childrenIds\": [ \"block-1737229372503\" ] } }, \"block-1737229372503\": { \"type\": \"Container\", \"data\": { \"style\": { \"padding\": { \"top\": 24, \"bottom\": 24, \"right\": 32, \"left\": 32 } }, \"props\": { \"childrenIds\": [ \"block-1737229386674\", \"block-1737229395871\", \"block-1737229536738\", \"block-1737229551815\" ] } } }, \"block-1737229386674\": { \"type\": \"Heading\", \"data\": { \"props\": { \"text\": \"Hi {{ firstname | there }}\" }, \"style\": { \"padding\": { \"top\": 16, \"bottom\": 16, \"right\": 24, \"left\": 24 } } } }, \"block-1737229395871\": { \"type\": \"Text\", \"data\": { \"style\": { \"fontWeight\": \"normal\", \"padding\": { \"top\": 16, \"bottom\": 16, \"right\": 24, \"left\": 24 } }, \"props\": { \"text\": \"We’re glad to have you with us at {{ pagename }}!\" } } }, \"block-1737229536738\": { \"type\": \"Text\", \"data\": { \"style\": { \"fontWeight\": \"normal\", \"padding\": { \"top\": 16, \"bottom\": 16, \"right\": 24, \"left\": 24 } }, \"props\": { \"text\": \"To finish subscribing to our emails, just click the button below. You can unsubscribe anytime if you change your mind.\" } } }, \"block-1737229551815\": { \"type\": \"Button\", \"data\": { \"style\": { \"fontWeight\": \"bold\", \"textAlign\": \"center\", \"padding\": { \"top\": 16, \"bottom\": 16, \"right\": 24, \"left\": 24 } }, \"props\": { \"buttonBackgroundColor\": \"#4F46E5\", \"fullWidth\": true, \"text\": \"Subscribe!\", \"url\": \"{{ hostname }}/subscribe/optin?contactUUID={{ contactUUID }}\" } } } }", "Confirm your email address")
4848

4949
exec(conn, sql("INSERT INTO settings (page_name, hostname, optin_email) VALUES (?, ?, ?) ON CONFLICT DO NOTHING;"), "Nimletter, drip it!", "https://nimletter.com", 1)
5050

src/database/db_schema_sqlite.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ CREATE TABLE IF NOT EXISTS mails (
2020
uuid TEXT NOT NULL DEFAULT (lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-' || '4' || substr(lower(hex(randomblob(2))), 2) || '-' || substr('89ab', abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))), 2) || '-' || lower(hex(randomblob(6)))) -- Unique identifier
2121
);
2222

23-
INSERT INTO mails (name, identifier, category, contentHTML, contentEditor, subject) VALUES ('Double Opt-In', 'double-opt-in', 'template', '<div style="background-color:#F5F5F5;color:#262626;font-family:&quot;Helvetica Neue&quot;, &quot;Arial Nova&quot;, &quot;Nimbus Sans&quot;, Arial, sans-serif;font-size:16px;font-weight:400;letter-spacing:0.15008px;line-height:1.5;margin:0;padding:32px 0;min-height:100%;width:100%"><table align="center" width="100%" style="margin:0 auto;max-width:600px;background-color:#FFFFFF" role="presentation" cellSpacing="0" cellPadding="0" border="0"><tbody><tr style="width:100%"><td><div style="padding:24px 32px 24px 32px"><h2 style="font-weight:bold;margin:0;font-size:24px;padding:16px 24px 16px 24px">Hi {{ firstname | there }}</h2><div style="font-weight:normal;padding:16px 24px 16px 24px">We’re glad to have you with us at {{ pagename }}!</div><div style="font-weight:normal;padding:16px 24px 16px 24px">To finish subscribing to our emails, just click the button below. You can unsubscribe anytime if you change your mind.</div><div style="text-align:center;padding:16px 24px 16px 24px"><a href="{{ hostname }}/subscribe/optin" style="color:#FFFFFF;font-size:16px;font-weight:bold;background-color:#4F46E5;border-radius:4px;display:block;padding:12px 20px;text-decoration:none" target="_blank"><span><!--[if mso]><i style="letter-spacing: 20px;mso-font-width:-100%;mso-text-raise:30" hidden>&nbsp;</i><![endif]--></span><span>Subscribe!</span><span><!--[if mso]><i style="letter-spacing: 20px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]--></span></a></div></div></td></tr></tbody></table></div>', '{ "root": { "type": "EmailLayout", "data": { "backdropColor": "#F5F5F5", "canvasColor": "#FFFFFF", "textColor": "#262626", "fontFamily": "MODERN_SANS", "childrenIds": [ "block-1737229372503" ] } }, "block-1737229372503": { "type": "Container", "data": { "style": { "padding": { "top": 24, "bottom": 24, "right": 32, "left": 32 } }, "props": { "childrenIds": [ "block-1737229386674", "block-1737229395871", "block-1737229536738", "block-1737229551815" ] } } }, "block-1737229386674": { "type": "Heading", "data": { "props": { "text": "Hi {{ firstname | there }}" }, "style": { "padding": { "top": 16, "bottom": 16, "right": 24, "left": 24 } } } }, "block-1737229395871": { "type": "Text", "data": { "style": { "fontWeight": "normal", "padding": { "top": 16, "bottom": 16, "right": 24, "left": 24 } }, "props": { "text": "We’re glad to have you with us at {{ pagename }}!" } } }, "block-1737229536738": { "type": "Text", "data": { "style": { "fontWeight": "normal", "padding": { "top": 16, "bottom": 16, "right": 24, "left": 24 } }, "props": { "text": "To finish subscribing to our emails, just click the button below. You can unsubscribe anytime if you change your mind." } } }, "block-1737229551815": { "type": "Button", "data": { "style": { "fontWeight": "bold", "textAlign": "center", "padding": { "top": 16, "bottom": 16, "right": 24, "left": 24 } }, "props": { "buttonBackgroundColor": "#4F46E5", "fullWidth": true, "text": "Subscribe!", "url": "{{ hostname }}/subscribe/optin" } } } }', 'Confirm your email address');
2423

2524
-- Table for flows (campaigns or automated sequences)
2625
CREATE TABLE IF NOT EXISTS flows (

0 commit comments

Comments
 (0)