Forget-Me-Not/post_handlers/send_reminders_post_handler...

19 lines
567 B
Nim

#[Copyright 2025 ITwrx.
This file is part of Forget-Me-Not.
Forget-Me-Not is released under the GNU Affero General Public License 3.0.
See COPYING or <https://www.gnu.org/licenses/> for details.]#
import guildenstern/httpserver, "../helpers/reminder", "../helpers/form"
proc sendRemindersPostHandler*() =
try:
if formInput("send_reminders_key") == "your-key-string-goes-here":
sendReminders()
reply(Http200)
else:
echo "'send_reminders_key' not valid"
reply(Http403)
except CatchableError as e:
echo e.msg
reply(Http500)