Permalink
Browse files

Make it easier for sublcasses to modify the email footer

  • Loading branch information...
1 parent 59c0055 commit c199a157c2a19d9631e87cefb32c5fd95cc0b07f @marineam marineam committed Aug 16, 2011
Showing with 18 additions and 8 deletions.
  1. +18 −8 python/nagcat/plugins/notify_smtp.py
@@ -100,14 +100,21 @@ def headers(self):
def body(self):
text = super(EmailNotification, self).body()
- if self.format == "long":
- urls = self.urls()
- if urls:
- text += "\n"
- if 'nagios' in urls:
- text += "Nagios: %s\n" % urls['nagios']
- if 'graphs' in urls:
- text += "Graphs: %s\n" % urls['graphs']
+ text += self.footer()
+ return text
+
+ def footer(self):
+ urls = self.urls()
+
+ if urls:
+ text = "\n"
+ if 'nagios' in urls:
+ text += "Nagios: %s\n" % urls['nagios']
+ if 'graphs' in urls:
+ text += "Graphs: %s\n" % urls['graphs']
+ else:
+ text = ""
+
return text
def send(self):
@@ -169,6 +176,9 @@ def headers(self):
headers['To'] = self.macros['CONTACTPAGER']
return headers
+ def footer():
+ return ""
+
def graph(self):
return None

0 comments on commit c199a15

Please sign in to comment.