{"id":25043065,"url":"https://github.com/dinujaya-sandaruwan/bulk-send-emails-nodejs","last_synced_at":"2026-05-03T06:37:02.520Z","repository":{"id":265574039,"uuid":"872167570","full_name":"Dinujaya-Sandaruwan/Bulk-Send-Emails-NodeJS","owner":"Dinujaya-Sandaruwan","description":"This script automates the process of sending application PDFs to school A/L applicants, ensuring that they receive their application in PDF format, which they need to print and bring to their interview. The script reads applicant data from a JSON file and makes API requests to generate and send the PDF for each application.","archived":false,"fork":false,"pushed_at":"2024-10-14T00:21:39.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T13:07:28.589Z","etag":null,"topics":["automation","mail-server","nodejs","scripting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dinujaya-Sandaruwan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-14T00:16:34.000Z","updated_at":"2024-10-14T00:23:45.000Z","dependencies_parsed_at":"2024-11-30T00:45:39.650Z","dependency_job_id":"3eef3e52-4ceb-4b3d-9ed9-9c983543fd1d","html_url":"https://github.com/Dinujaya-Sandaruwan/Bulk-Send-Emails-NodeJS","commit_stats":null,"previous_names":["dinujaya-sandaruwan/bulk-send-emails-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dinujaya-Sandaruwan%2FBulk-Send-Emails-NodeJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dinujaya-Sandaruwan%2FBulk-Send-Emails-NodeJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dinujaya-Sandaruwan%2FBulk-Send-Emails-NodeJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dinujaya-Sandaruwan%2FBulk-Send-Emails-NodeJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dinujaya-Sandaruwan","download_url":"https://codeload.github.com/Dinujaya-Sandaruwan/Bulk-Send-Emails-NodeJS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246392847,"owners_count":20769817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","mail-server","nodejs","scripting"],"created_at":"2025-02-06T04:52:27.984Z","updated_at":"2026-05-03T06:36:57.497Z","avatar_url":"https://github.com/Dinujaya-Sandaruwan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated PDF Delivery for School A/L Applicants\n\nThis Node.js script automates the process of sending application PDFs to school A/L applicants. Each applicant receives their application in PDF format, which they need to print and bring to their interview. The script reads applicant data from a `data.json` file and makes API requests to send the PDFs for each application.\n\n## Features\n\n- Automatically processes a list of applicants from a JSON file.\n- Sends each applicant's PDF to the provided API endpoint.\n- Logs successful deliveries and reports errors.\n- Stops on error to prevent issues with the remaining applications.\n\n## How It Works\n\nThe script:\n1. Loads applicant data from a JSON file (`data.json`).\n2. For each applicant, it makes a request to the API (`/api/\u003cindexNumber\u003e/pdf`) to generate and send the PDF.\n3. Logs success or error messages for each applicant.\n4. If an error occurs, the script stops and logs the last successfully processed application.\n\n## Installation\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/yourusername/your-repo-name.git\n    cd your-repo-name\n    ```\n\n2. Install dependencies:\n\n    ```bash\n    npm install\n    ```\n\n3. Create a `data.json` file in the project root. The file should contain an array of objects, each with an `olindexno` property (representing the applicant's index number). Example:\n\n    ```json\n    [\n      {\n        \"olindexno\": \"12345\"\n      },\n      {\n        \"olindexno\": \"67890\"\n      }\n    ]\n    ```\n\n## Usage\n\n1. Ensure the API endpoint (`BASE_API_ENDPOINT` in the script) is configured correctly.\n2. Run the script:\n\n    ```bash\n    node your-script-name.js\n    ```\n\n3. The script will process each applicant's index number and attempt to send the PDF. Successful and failed deliveries will be logged in the console.\n\n## API Endpoint\n\nThe script assumes your API is running locally at `http://localhost:3000/api`. It sends GET requests to the endpoint `/api/\u003cindexNumber\u003e/pdf` to retrieve and deliver each applicant's PDF.\n\n## Error Handling\n\n- If an error occurs while processing an applicant, the script logs the error and stops further processing.\n- The last successfully processed index number will be logged to help troubleshoot issues.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinujaya-sandaruwan%2Fbulk-send-emails-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinujaya-sandaruwan%2Fbulk-send-emails-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinujaya-sandaruwan%2Fbulk-send-emails-nodejs/lists"}