From c4500c88687358990aef7058512b62f912f1a9de Mon Sep 17 00:00:00 2001 From: volkansahin Date: Thu, 20 Jul 2017 10:38:13 +0300 Subject: [PATCH] context mail feature added to profile --- opt/ahenk/base/plugin/plugin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/opt/ahenk/base/plugin/plugin.py b/opt/ahenk/base/plugin/plugin.py index b5585d9..3be4c7f 100644 --- a/opt/ahenk/base/plugin/plugin.py +++ b/opt/ahenk/base/plugin/plugin.py @@ -141,7 +141,7 @@ class Plugin(threading.Thread): if self.context.data is not None and self.context.get('responseCode') is not None: self.logger.debug('[Plugin] Creating response') response = Response(type=MessageType.TASK_STATUS.value, id=item_obj.get_id(), - code=self.context.get('responseCode'), + code=self.context.get('responseCode'), message=self.context.get('responseMessage'), data=self.context.get('responseData'), content_type=self.context.get('contentType')) @@ -188,6 +188,12 @@ class Plugin(threading.Thread): profile_data = item_obj.get_profile_data() self.context.put('username', item_obj.get_username()) + json_profile_data=json.loads(profile_data) + self.context.set_mail_send(json_profile_data['mailSend'] if 'mailSend' in json_profile_data else False) + self.context.set_mail_subject(json_profile_data['mailSubject'] if 'mailSubject' in json_profile_data else '') + self.context.set_mail_content(json_profile_data['mailContent'] if 'mailContent' in json_profile_data else '') + + execution_id = self.get_execution_id(item_obj.get_id()) policy_ver = self.get_policy_version(item_obj.get_id())