OSDN Git Service

Plugin::Sendmail: don't send mail when mode is 'test'
authorhylom <hylom@users.sourceforge.jp>
Tue, 8 Jan 2019 09:03:03 +0000 (18:03 +0900)
committerhylom <hylom@users.sourceforge.jp>
Tue, 8 Jan 2019 09:03:03 +0000 (18:03 +0900)
src/newslash_web/lib/Newslash/Plugin/Sendmail.pm

index 1112c05..49247f9 100644 (file)
@@ -58,6 +58,11 @@ sub _send {
                                                           timeout => $smtp_timeout,
                                                         });
 
+    # if 'test' mode, don't send message
+    if ($self->app->mode eq "test") {
+        return 1;
+    }
+
     # send message
     my $rs = eval { Email::Sender::Simple->send($email, {transport => $transport}) };
     if (!$rs) {