My favorites
▼
|
Sign in
substruct
Open-source Ruby on Rails E-Commerce
Project Home
Downloads
Wiki
Issues
Source
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
73
attachment: more_meaningfull_mailer_rescue_messages.patch
(1.9 KB)
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
Index: /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/order.rb
===================================================================
--- /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/order.rb (revision 43)
+++ /home/edmundo/workspace_aptana/substruct_trunk/vendor/plugins/substruct/app/models/order.rb (working copy)
@@ -531,7 +531,7 @@
begin
self.deliver_receipt
rescue => e
- logger.error("FAILED TO SEND THE CONFIRM EMAIL")
+ logger.error("FAILED TO SEND THE CONFIRM EMAIL: #{e}")
end
return true
else
@@ -546,7 +546,7 @@
begin
self.deliver_failed
rescue => e
- logger.error("FAILED TO SEND THE CONFIRM EMAIL")
+ logger.error("FAILED TO SEND THE CONFIRM EMAIL: #{e}")
end
return response.message
@@ -608,7 +608,12 @@
# I'm getting around this by passing the text into the mailer.
def deliver_receipt
@content_node = ContentNode.find(:first, :conditions => ["name = ?", 'OrderReceipt'])
- OrdersMailer.deliver_receipt(self, @content_node.content)
+ if @content_node
+ OrdersMailer.deliver_receipt(self, @content_node.content)
+ else
+ logger.error("The system didn't found a content node record named \"OrderReceipt\", this record " +
+ "is used in the e-mail body. The e-mail deliver cannot proceed.")
+ end
end
# If we're going to define deliver_receipt here, why not wrap deliver_failed as well?
@@ -691,7 +696,7 @@
begin
order.deliver_receipt
rescue => e
- logger.error("FAILED TO SEND THE CONFIRM EMAIL")
+ logger.error("FAILED TO SEND THE CONFIRM EMAIL: #{e}")
end
order.save
end
@@ -706,7 +711,7 @@
begin
order.deliver_failed
rescue => e
- logger.error("FAILED TO SEND THE CONFIRM EMAIL")
+ logger.error("FAILED TO SEND THE CONFIRM EMAIL: #{e}")
end
order.save
end
Powered by
Google Project Hosting