What the API Does:
Handles JSON POST Requests
The API listens for POST requests containing JSON data and sends emails based on that information.
Validates Required Fields
Before sending the email, it ensures that all the necessary data (like subject, backup file name, and server details) are present. This prevents errors and ensures reliable email notifications.
Customizable Email Templates
The system uses HTML templates for both success and failure notifications, allowing you to send professional-looking emails every time.
PHPMailer Integration
The API leverages PHPMailer for robust email handling, ensuring compatibility with a wide range of SMTP servers and email providers.
Technologies Used
PHP : The project is built with PHP, ensuring compatibility with modern server environments.
PHPMailer: The email sending is powered by PHPMailer, which is widely used and well-documented.
Composer: Composer is used to manage dependencies, including PHPMailer, making setup a breeze.
Web Server: The API can run on Apache, Nginx, or any other server that supports PHP
Why This Project?
This API was developed to complement a Bash script used for performing hourly backups. The Bash script runs on a scheduled basis, and after each backup, it sends the backup status to this PHP Mailer API. Based on the information received, the API then sends a corresponding email notification to the system owner, informing them whether the backup was successful or failed.
The goal was to create a simple yet effective solution that automates the backup notification process. The PHP Mailer API ensures that the backup status is communicated reliably and promptly, allowing system owners to stay updated without manual intervention. The integration between the Bash script and the PHP API makes this process seamless and efficient.
Here Bash script project that interacts with this API: