@@ -123,6 +123,15 class Mailer < ActionMailer::Base | |||
|
123 | 123 | body :url => url_for(:controller => 'welcome') |
|
124 | 124 | end |
|
125 | 125 | |
|
126 | # Overrides default deliver! method to prevent from sending an email | |
|
127 | # with no recipient, cc or bcc | |
|
128 | def deliver!(mail = @mail) | |
|
129 | return false if (recipients.nil? || recipients.empty?) && | |
|
130 | (cc.nil? || cc.empty?) && | |
|
131 | (bcc.nil? || bcc.empty?) | |
|
132 | super | |
|
133 | end | |
|
134 | ||
|
126 | 135 | private |
|
127 | 136 | def initialize_defaults(method_name) |
|
128 | 137 | super |
General Comments 0
You need to be logged in to leave comments.
Login now