This project is an API for sending emails to clients using Spring Boot. The frontend can utilize the API by making a POST
request and passing the required information in a JSON format.
To send an email, the frontend needs to include the following fields in the request body:
ownerRef
: Reference to the owner of the email.emailFrom
: Sender's email address.emailTo
: Recipient's email address.subject
: Subject of the email.text
: Body of the email.
The following technologies were used in this project:
- JDK 15
- Spring Boot
- Maven
- Postman
- PostgreSQL
To set up the project, follow these steps:
- Clone the repository.
- Open the project in NetBeans or any Java IDE.
- Build the project using Maven.
- Configure the PostgreSQL database according to the application.properties file.
- Run the application.
- The API will be available at
http://localhost:8080
.
The API is deployed and can be accessed at https://api-send-email.up.railway.app.
POST /send-email
: Sends an email to the client.- Request body (JSON):
{ "ownerRef": "owner123", "emailFrom": "sender@example.com", "emailTo": "recipient@example.com", "subject": "Example Subject", "text": "This is the body of the email." }
- Request body (JSON):
You can test the API using Postman:
- Make sure the application is running.
- Open Postman and import the provided collection file: Postman Collection.
- Use the imported collection to test the API endpoints.
For more details, refer to the Postman documentation.