File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change
1
+ import logging
1
2
from decimal import Decimal
2
3
from django .utils import timezone
3
4
from django .conf import settings
8
9
from django .template import Context
9
10
from django .template .loader import get_template
10
11
12
+ logger = logger .getLogger ()
13
+
11
14
class HolviOverdueInvoicesHandler (object ):
12
15
def process_overdue (self , send = False ):
13
16
barcode_iban = settings .HOLVI_BARCODE_IBAN
@@ -37,7 +40,10 @@ def process_overdue(self, send=False):
37
40
mail .body = body_template .render (Context ({ "invoice" : invoice , "barcode" : barcode }))
38
41
mail .to = [invoice .receiver .email ]
39
42
if send :
40
- mail .send ()
43
+ try :
44
+ mail .send ()
45
+ except Exception as e :
46
+ logger .exception ("Sending email failed" )
41
47
42
48
try :
43
49
notified = NotificationSent .objects .get (transaction_unique_id = invoice .code )
You can’t perform that action at this time.
0 commit comments