Skip to content

Commit 8d922ed

Browse files
committed
bugfixy sunday
1 parent 2ec6154 commit 8d922ed

File tree

2 files changed

+11
-11
lines changed

2 files changed

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

src/scheduling/schedule_mail.nim

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ proc createPendingEmail*(
5151
scheduledTime: string = "",
5252
) =
5353

54-
var scheduledFor: string
54+
var scheduledForFormatted: string
5555
if triggerType == "delay":
56-
scheduledFor = $scheduledFor.format("yyyy-MM-dd HH:mm:ss")
56+
scheduledForFormatted = $scheduledFor.format("yyyy-MM-dd HH:mm:ss")
5757
elif triggerType == "immediate":
58-
scheduledFor = $(now().utc).format("yyyy-MM-dd HH:mm:ss")
58+
scheduledForFormatted = $(now().utc).format("yyyy-MM-dd HH:mm:ss")
5959
elif triggerType == "time":
6060
if scheduledTime != "":
6161
# Combine current date with the scheduled time
@@ -65,15 +65,15 @@ proc createPendingEmail*(
6565

6666
# If the time has already passed today, schedule for tomorrow
6767
if scheduledDateTime < now().utc:
68-
scheduledFor = $(scheduledDateTime + 1.days).format("yyyy-MM-dd HH:mm:ss")
68+
scheduledForFormatted = $(scheduledDateTime + 1.days).format("yyyy-MM-dd HH:mm:ss")
6969
else:
70-
scheduledFor = $scheduledDateTime.format("yyyy-MM-dd HH:mm:ss")
70+
scheduledForFormatted = $scheduledDateTime.format("yyyy-MM-dd HH:mm:ss")
7171
else:
72-
scheduledFor = $(now().utc).format("yyyy-MM-dd HH:mm:ss")
72+
scheduledForFormatted = $(now().utc).format("yyyy-MM-dd HH:mm:ss")
7373
else:
74-
scheduledFor = "NULL"
74+
scheduledForFormatted = "NULL"
7575

76-
echo "Scheduled for " & scheduledFor & " for user " & userID
76+
echo "Scheduled for " & scheduledForFormatted & " for user " & userID
7777

7878
var args = @[userID]
7979
var data = @["user_id"]
@@ -95,9 +95,9 @@ proc createPendingEmail*(
9595
if status != "":
9696
data.add("status")
9797
args.add(status)
98-
if scheduledFor != "NULL":
98+
if scheduledForFormatted != "NULL":
9999
data.add("scheduled_for")
100-
args.add(scheduledFor)
100+
args.add(scheduledForFormatted)
101101
if manualSubject != "":
102102
data.add("manual_subject")
103103
args.add(manualSubject)

0 commit comments

Comments
 (0)