Permalink
Browse files

Added description in the email sent

  • Loading branch information...
swarbhanu committed Dec 6, 2012
1 parent 62eb8be commit d13ee7287124deb5ae47ab3b10f28e43c764b0f5
@@ -110,6 +110,7 @@ def process_event(self, msg, headers):
msg_recipient = self.user_info[user_id]['user_contact'].email
self.smtp_client = setting_up_smtp_client()
send_email(message = msg, msg_recipient = msg_recipient, smtp_client = self.smtp_client )
+ self.smtp_client.quit()
def on_stop(self):
# close subscribers safely
@@ -124,20 +124,23 @@ def send_email(message, msg_recipient, smtp_client):
event = message.type_
origin = message.origin
description = message.description
+ event_obj_as_string = str(message)
#------------------------------------------------------------------------------------
# build the email from the event content
#------------------------------------------------------------------------------------
- msg_body = string.join(("Event: %s," % event,
+ msg_body = string.join(("Event type: %s," % event,
"",
"Originator: %s," % origin,
"",
- "Description: %s," % description ,
+ "Description: %s," % description,
"",
"Time stamp: %s," % time_stamp,
"",
+ "Event object as a dictionary: %s," % event_obj_as_string,
+ "",
"You received this notification from ION because you asked to be "\
"notified about this event from this source. ",
"To modify or remove notifications about this event, "\

0 comments on commit d13ee72

Please sign in to comment.