Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added description in the email sent

  • Loading branch information...
commit d13ee7287124deb5ae47ab3b10f28e43c764b0f5 1 parent 62eb8be
@swarbhanu swarbhanu authored
View
1  ion/processes/data/transforms/notification_worker.py
@@ -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
View
7 ion/services/dm/utility/uns_utility_methods.py
@@ -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, "\
Please sign in to comment.
Something went wrong with that request. Please try again.