Description
When sending an email using the Alert-Report-Test feature, the to field does not correctly validate the email address format. This results in a misleading "result": "OK" response even when the email address is just a string number, not a valid email.
Steps to Reproduce
1. Send an email with the following payload:
```json
{
"to": ["1"],
"cc": ["2"],
"subject": "Alert-Report-Test",
"body": {
"template": "/Templates/Email/message.md",
"params": {
"name": "I am testing a md template"
}
}
}
Observe the response:
Expected Behavior
The system should validate both to and cc fields to ensure they contain valid email addresses and return an error if the formats are incorrect.
Actual Behavior
The system returns a "result": "OK" even when the to and cc fields are not valid email addresses.
Possible Solution
- Implement email format validation for both the to and cc fields in the email sending functionality.
- Ensure that any non-valid email formats are caught and an appropriate error message is returned.
Description
When sending an email using the Alert-Report-Test feature, the
tofield does not correctly validate the email address format. This results in a misleading "result": "OK" response even when the email address is just a string number, not a valid email.Steps to Reproduce
Observe the response:
Expected Behavior
The system should validate both to and cc fields to ensure they contain valid email addresses and return an error if the formats are incorrect.
Actual Behavior
The system returns a "result": "OK" even when the to and cc fields are not valid email addresses.
Possible Solution