Skip to content

Commit 0e15677

Browse files
committed
Bump
1 parent 27fc676 commit 0e15677

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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.6"
3+
version = "0.3.7"
44
author = "ThomasTJdev"
55
description = "Newsletter"
66
license = "AGPL v3"

src/database/database_setup.nim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ proc databaseCreate*() =
4444
echo "Error executing SQL: " & sqlItem
4545
echo "Got this error code: " & getCurrentExceptionMsg()
4646

47+
if getAllRows(conn, sql("SELECT * FROM mails")).len > 0:
48+
return
49+
4750
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")
4851

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

0 commit comments

Comments
 (0)