case 4762 - direct email to a user: messages say "User", not "Vendor"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -339,10 +339,11 @@ namespace AyaNova.Api.Controllers
|
||||
bool isContact = o.UserType == UserType.Customer || o.UserType == UserType.HeadOffice;
|
||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.User) && !(isContact && Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer)))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
//case 4762: these said "Vendor"
|
||||
if (string.IsNullOrWhiteSpace(o.EmailAddress))
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_MISSING_PROPERTY, "EmailAddress", $"Vendor {o.Name} doesn't have an email address no where to send this"));
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_MISSING_PROPERTY, "EmailAddress", $"User {o.Name} doesn't have an email address no where to send this"));
|
||||
if (o.Active == false)
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, "Active", $"Vendor {o.Name} is not active, only active Vendors can be emailed directly"));
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, "Active", $"User {o.Name} is not active, only active users can be emailed directly"));
|
||||
notifyDirectSMTP.ToAddress = o.EmailAddress;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user