Showing 1 changed files with 8 additions and 3 deletions
+8 -3
action/action
... ...
@@ -132,20 +132,23 @@ foreach my $category (keys(%{$polls})) {
132 132
 # $dbh->commit();
133 133
 $dbh->disconnect();
134 134
 
135
+exit if (! -r $cfg::config{notification}->{flag});
136
+
135 137
 my ($mail,$error)=Email::Send::SMTP::Gmail->new(%{$cfg::config{notification}{from}});
136 138
 die "session error: $error" unless ($mail!=-1);
137 139
 
138 140
 foreach my $dest (keys(%{$cfg::config{notification}->{to}})) {
139 141
 
142
+    if (defined($cfg::config{notification}->{to}->{test}->{address}) and $dest ne 'test') {
143
+        continue;
144
+    }
140 145
     my $data = '';
141 146
 
142 147
     if (substr($cfg::config{notification}->{to}->{$dest}->{intro}, 0, 1) eq "@") {
143 148
         if (-r $cfg::config{notification}->{intro_default_path} . substr($cfg::config{notification}->{to}->{$dest}->{intro},1) . $cfg::config{notification}->{intro_suffix}) {
144 149
             open INTRO, $cfg::config{notification}->{intro_default_path} . substr($cfg::config{notification}->{to}->{$dest}->{intro},1) . $cfg::config{notification}->{intro_suffix};
145 150
             while (<INTRO>) {
146
-                if (/^<body /../^<\/body>/) {
147
-                    $data .= $_ unless /^<body / or /^<\/body>/;
148
-                }
151
+                $data .= $_ . '<br>';
149 152
             }
150 153
             close INTRO;
151 154
         }
... ...
@@ -175,6 +178,8 @@ foreach my $dest (keys(%{$cfg::config{notification}->{to}})) {
175 178
 
176 179
     $data .= $cfg::config{notification}->{to}->{$dest}->{outro};
177 180
 
181
+    $data =~ s/\n/<br>/g;
182
+
178 183
     $mail->send(
179 184
             -from=>$cfg::config{notification}{from_infos}{from},
180 185
             -replyto=>$cfg::config{notification}{from_infos}{replyto},