updated spiffworkflow-connector-command

This commit is contained in:
jasquat 2023-10-18 09:25:52 -04:00
parent 353e51546f
commit defbf7c63c
No known key found for this signature in database
2 changed files with 11 additions and 11 deletions

2
poetry.lock generated
View File

@ -326,7 +326,7 @@ typing-extensions = "^4.8.0"
type = "git"
url = "https://github.com/sartography/spiffworkflow-connector-command.git"
reference = "main"
resolved_reference = "88bcbafdb1ffbf3f85fa9f13e05e41ace48b0988"
resolved_reference = "022c01826e98fd3997ec21652c88c1343279b6f4"
[[package]]
name = "tomli"

View File

@ -3,7 +3,7 @@ from smtplib import SMTP
from typing import Any
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 ConnectorProxyResponseDict
@ -28,7 +28,7 @@ class SendEmail(ConnectorCommand):
self.email_to = email_to
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.set_content(self.email_body)
message["Subject"] = self.email_subject
@ -51,15 +51,15 @@ class SendEmail(ConnectorCommand):
logs.append(f'did error: {str(exception)}')
error = {"error_code": exception.__class__.__name__, "message": str(exception)}
return_response: ConnectorProxyResponseDict = {
"command_response": {},
"spiff__logs": logs,
"error": error,
}
result: CommandResultDictV2 = {
"response": return_response,
"status": 200,
return_response: CommandResponseDict = {
"body": {},
"mimetype": "application/json",
}
result: ConnectorProxyResponseDict = {
"command_response": return_response,
"error": error,
"command_response_version": 2,
"spiff__logs": logs,
}
return result