Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Write status to email send request response #4652

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public static String send(Context ctx) {
ctx.status(422);
String msg = "Error parsing request: " + e.getMessage();
logger.error(msg);
ctx.result(msg);
return msg;
}

Expand All @@ -86,6 +87,7 @@ public static String send(Context ctx) {
String msg =
"Error validating message receivers: " + executionResult.getErrors().get(0).getMessage();
logger.error(msg);
ctx.result(msg);
return msg;
}
Map<String, Object> resultMap = executionResult.toSpecification();
Expand All @@ -97,13 +99,15 @@ public static String send(Context ctx) {
ctx.status(500);
String msg = "Error validating message receivers: " + e.getMessage();
logger.error(msg);
ctx.result(msg);
return msg;
}

if (recipients.isEmpty()) {
ctx.status(500);
String msg = "No recipients found for given filter";
logger.error(msg);
ctx.result(msg);
return msg;
}

Expand Down Expand Up @@ -133,6 +137,7 @@ public static String send(Context ctx) {
sendMessageAction.subject(),
sendMessageAction.body());
}
ctx.result(String.valueOf(sendResult));
return String.valueOf(sendResult);
}

Expand Down