@@ -297,31 +297,6 class Mailer < ActionMailer::Base | |||
|
297 | 297 | :subject => 'Redmine test' |
|
298 | 298 | end |
|
299 | 299 | |
|
300 | # Overrides default deliver! method to prevent from sending an email | |
|
301 | # with no recipient, cc or bcc | |
|
302 | def deliver!(mail = @mail) | |
|
303 | set_language_if_valid @initial_language | |
|
304 | return false if (recipients.nil? || recipients.empty?) && | |
|
305 | (cc.nil? || cc.empty?) && | |
|
306 | (bcc.nil? || bcc.empty?) | |
|
307 | ||
|
308 | ||
|
309 | # Log errors when raise_delivery_errors is set to false, Rails does not | |
|
310 | raise_errors = self.class.raise_delivery_errors | |
|
311 | self.class.raise_delivery_errors = true | |
|
312 | begin | |
|
313 | return super(mail) | |
|
314 | rescue Exception => e | |
|
315 | if raise_errors | |
|
316 | raise e | |
|
317 | elsif mylogger | |
|
318 | mylogger.error "The following error occured while sending email notification: \"#{e.message}\". Check your configuration in config/configuration.yml." | |
|
319 | end | |
|
320 | ensure | |
|
321 | self.class.raise_delivery_errors = raise_errors | |
|
322 | end | |
|
323 | end | |
|
324 | ||
|
325 | 300 | # Sends reminders to issue assignees |
|
326 | 301 | # Available options: |
|
327 | 302 | # * :days => how many days in the future to remind about (defaults to 7) |
General Comments 0
You need to be logged in to leave comments.
Login now