summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/initializers/10-patches.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index 5fbb91abf..d1235d93f 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -15,3 +15,17 @@ ActiveRecord::Errors.default_error_messages = {
} if ActiveRecord::Errors.respond_to?('default_error_messages=')
ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
+
+# Adds :async_smtp and :async_sendmail delivery methods
+# to perform email deliveries asynchronously
+module AsynchronousMailer
+ %w(smtp sendmail).each do |type|
+ define_method("perform_delivery_async_#{type}") do |mail|
+ Thread.start do
+ send "perform_delivery_#{type}", mail
+ end
+ end
+ end
+end
+
+ActionMailer::Base.send :include, AsynchronousMailer
n/content/xdocs/1.0/known-issues.xml?h=Temp_ComplexScripts'>known-issues.xml
blob: 2ef4b7102ef2d5f0ae22c81150618c6e12d6e5d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91