You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an API endpoint to handle user inquiries from the "Contact Us" form. This endpoint will validate the input data and send the inquiry to a specified email address.
Acceptance Criteria
API Endpoint Implementation:
The endpoint should be accessible at /api/v1/contact.
The endpoint should accept HTTP POST requests.
Data Validation and Sanitization:
The API should validate the request payload to ensure all required fields (name, email, message) are present and valid.
Email Sending:
The API should send the user's inquiry to a specified email address.
Response:
On success, the API should return a 200 OK status code with a success message.
On failure, the API should return a 400 Bad Request status code with appropriate error messages.
{
"message": "string",
"errors": [
"string",
],
"status": int
}
Purpose
Provides a backend service to handle user inquiries from the "Contact Us" form, ensuring data is validated and inquiries are sent to the appropriate email address.
Requirements
Develop server-side logic to handle "Contact Us" form submissions.
Validate and sanitize incoming user data.
Send inquiries to a specified email address using an email service (e.g., SendGrid, SMTP).
Expected Outcome
API endpoint allows users to submit inquiries via the "Contact Us" form, and ensures the inquiries are sent to the appropriate email address.
status code
200: Inquiry was successfully sent.
400:
name must be a string
email must be a valid email
message must be provided
500: A server error occurred
Testing
Write unit tests to ensure the "Contact Us" endpoint validates input correctly and sends emails.
Perform load testing to ensure the endpoint can handle multiple requests.
Test various scenarios for submitting the "Contact Us" form.
The text was updated successfully, but these errors were encountered:
Description
Create an API endpoint to handle user inquiries from the "Contact Us" form. This endpoint will validate the input data and send the inquiry to a specified email address.
Acceptance Criteria
/api/v1/contact.
Request Example:
POST /api/v1/contact
Successful Response:
Error Response:
Purpose
Provides a backend service to handle user inquiries from the "Contact Us" form, ensuring data is validated and inquiries are sent to the appropriate email address.
Requirements
Expected Outcome
API endpoint allows users to submit inquiries via the "Contact Us" form, and ensures the inquiries are sent to the appropriate email address.
status code
200: Inquiry was successfully sent.
400:
500: A server error occurred
Testing
The text was updated successfully, but these errors were encountered: