Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasTJdev committed Feb 3, 2025
1 parent 27fc676 commit 0e15677
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nimletter.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.3.6"
version = "0.3.7"
author = "ThomasTJdev"
description = "Newsletter"
license = "AGPL v3"
Expand Down
3 changes: 3 additions & 0 deletions src/database/database_setup.nim
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ proc databaseCreate*() =
echo "Error executing SQL: " & sqlItem
echo "Got this error code: " & getCurrentExceptionMsg()

if getAllRows(conn, sql("SELECT * FROM mails")).len > 0:
return

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")

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

0 comments on commit 0e15677

Please sign in to comment.