From 73703981ebb67861d90e05a1f89cde888a2d0234 Mon Sep 17 00:00:00 2001 From: kidhab Date: Fri, 4 Mar 2022 11:27:10 +0100 Subject: [PATCH] Add setting to disable mail notifications --- config.example.php | 1 + index.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config.example.php b/config.example.php index d957e3e..52c6365 100644 --- a/config.example.php +++ b/config.example.php @@ -9,4 +9,5 @@ define("MAIL_USER", "incoming"); define("MAIL_PASSWORD", "****"); define("DECODE_SPECIAL_CHARACTERS", true); //requires mbstring, if false special characters (like öäüß) won't be displayed correctly define("ASSIGN_SENDER", true); // if true, sender will be assigned to card if has NC account +define("MAIL_NOTIFICATION", true); // if true, send notifications when a new card was created or an error occured ?> diff --git a/index.php b/index.php index 31ee957..f73f5e6 100644 --- a/index.php +++ b/index.php @@ -90,10 +90,14 @@ if ($emails) $response = $newcard->addCard($data, $mailSender, $board); $mailSender->userId .= "@{$overview->reply_to[0]->host}"; - if($response) { - $inbox->reply($mailSender->userId, $response); - } else { - $inbox->reply($mailSender->userId); + if(MAIL_NOTIFICATION) { + if($response) { + $inbox->reply($mailSender->userId, $response); + } else { + $inbox->reply($mailSender->userId); + } + } + if(!$response) { foreach($attNames as $attachment) unlink(getcwd() . "/attachments/" . $attachment); } }