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

[FEAT] Contact Us #132

Open
6 tasks
Jideco opened this issue Jul 27, 2024 · 0 comments
Open
6 tasks

[FEAT] Contact Us #132

Jideco opened this issue Jul 27, 2024 · 0 comments
Assignees

Comments

@Jideco
Copy link
Contributor

Jideco commented Jul 27, 2024

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

  1. API Endpoint Implementation:
  • The endpoint should be accessible at /api/v1/contact.
  • The endpoint should accept HTTP POST requests.
  1. Data Validation and Sanitization:
  • The API should validate the request payload to ensure all required fields (name, email, message) are present and valid.
  1. Email Sending:
  • The API should send the user's inquiry to a specified email address.
  1. 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.

Request Example:

POST /api/v1/contact

{
  "name": "string",
  "email": "string",
  "message": "string"
}

Successful Response:

{
  "message": "string",
  "status": int
}

Error Response:

{
  "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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant