Skip to content

Commit

Permalink
Make it easier for sublcasses to modify the email footer
Browse files Browse the repository at this point in the history
  • Loading branch information
marineam committed Aug 16, 2011
1 parent 59c0055 commit c199a15
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions python/nagcat/plugins/notify_smtp.py
Expand Up @@ -100,14 +100,21 @@ def headers(self):


def body(self): def body(self):
text = super(EmailNotification, self).body() text = super(EmailNotification, self).body()
if self.format == "long": text += self.footer()
urls = self.urls() return text
if urls:
text += "\n" def footer(self):
if 'nagios' in urls: urls = self.urls()
text += "Nagios: %s\n" % urls['nagios']
if 'graphs' in urls: if urls:
text += "Graphs: %s\n" % urls['graphs'] 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 return text


def send(self): def send(self):
Expand Down Expand Up @@ -169,6 +176,9 @@ def headers(self):
headers['To'] = self.macros['CONTACTPAGER'] headers['To'] = self.macros['CONTACTPAGER']
return headers return headers


def footer():
return ""

def graph(self): def graph(self):
return None return None


Expand Down

0 comments on commit c199a15

Please sign in to comment.