@@ -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