updated spiffworkflow-connector-command
This commit is contained in:
parent
353e51546f
commit
defbf7c63c
|
@ -326,7 +326,7 @@ typing-extensions = "^4.8.0"
|
||||||
type = "git"
|
type = "git"
|
||||||
url = "https://github.com/sartography/spiffworkflow-connector-command.git"
|
url = "https://github.com/sartography/spiffworkflow-connector-command.git"
|
||||||
reference = "main"
|
reference = "main"
|
||||||
resolved_reference = "88bcbafdb1ffbf3f85fa9f13e05e41ace48b0988"
|
resolved_reference = "022c01826e98fd3997ec21652c88c1343279b6f4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tomli"
|
name = "tomli"
|
||||||
|
|
|
@ -3,7 +3,7 @@ from smtplib import SMTP
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from spiffworkflow_connector_command.command_interface import CommandErrorDict
|
from spiffworkflow_connector_command.command_interface import CommandErrorDict
|
||||||
from spiffworkflow_connector_command.command_interface import CommandResultDictV2
|
from spiffworkflow_connector_command.command_interface import CommandResponseDict
|
||||||
from spiffworkflow_connector_command.command_interface import ConnectorCommand
|
from spiffworkflow_connector_command.command_interface import ConnectorCommand
|
||||||
from spiffworkflow_connector_command.command_interface import ConnectorProxyResponseDict
|
from spiffworkflow_connector_command.command_interface import ConnectorProxyResponseDict
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ class SendEmail(ConnectorCommand):
|
||||||
self.email_to = email_to
|
self.email_to = email_to
|
||||||
self.email_from = email_from
|
self.email_from = email_from
|
||||||
|
|
||||||
def execute(self, _config: Any, _task_data: Any) -> CommandResultDictV2:
|
def execute(self, _config: Any, _task_data: Any) -> ConnectorProxyResponseDict:
|
||||||
message = EmailMessage()
|
message = EmailMessage()
|
||||||
message.set_content(self.email_body)
|
message.set_content(self.email_body)
|
||||||
message["Subject"] = self.email_subject
|
message["Subject"] = self.email_subject
|
||||||
|
@ -51,15 +51,15 @@ class SendEmail(ConnectorCommand):
|
||||||
logs.append(f'did error: {str(exception)}')
|
logs.append(f'did error: {str(exception)}')
|
||||||
error = {"error_code": exception.__class__.__name__, "message": str(exception)}
|
error = {"error_code": exception.__class__.__name__, "message": str(exception)}
|
||||||
|
|
||||||
return_response: ConnectorProxyResponseDict = {
|
return_response: CommandResponseDict = {
|
||||||
"command_response": {},
|
"body": {},
|
||||||
"spiff__logs": logs,
|
|
||||||
"error": error,
|
|
||||||
}
|
|
||||||
result: CommandResultDictV2 = {
|
|
||||||
"response": return_response,
|
|
||||||
"status": 200,
|
|
||||||
"mimetype": "application/json",
|
"mimetype": "application/json",
|
||||||
}
|
}
|
||||||
|
result: ConnectorProxyResponseDict = {
|
||||||
|
"command_response": return_response,
|
||||||
|
"error": error,
|
||||||
|
"command_response_version": 2,
|
||||||
|
"spiff__logs": logs,
|
||||||
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue