{"id":30052664,"url":"https://github.com/nitdraig/mailprex","last_synced_at":"2026-05-06T00:33:23.619Z","repository":{"id":304778088,"uuid":"812100017","full_name":"nitdraig/mailprex","owner":"nitdraig","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-15T03:58:27.000Z","size":1177,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-15T11:25:02.890Z","etag":null,"topics":["email-service","nextjs","nodejs","open-source","webapp"],"latest_commit_sha":null,"homepage":"https://mailprex.excelso.xyz","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nitdraig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2024-06-08T00:51:27.000Z","updated_at":"2025-07-15T05:21:41.000Z","dependencies_parsed_at":"2025-07-15T11:30:51.380Z","dependency_job_id":"b46d806b-a593-4003-b89d-731b03f0ef4f","html_url":"https://github.com/nitdraig/mailprex","commit_stats":null,"previous_names":["nitdraig/mailprex"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nitdraig/mailprex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitdraig%2Fmailprex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitdraig%2Fmailprex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitdraig%2Fmailprex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitdraig%2Fmailprex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitdraig","download_url":"https://codeload.github.com/nitdraig/mailprex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitdraig%2Fmailprex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269292917,"owners_count":24392507,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["email-service","nextjs","nodejs","open-source","webapp"],"created_at":"2025-08-07T17:10:56.240Z","updated_at":"2026-05-06T00:33:23.606Z","avatar_url":"https://github.com/nitdraig.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://mailprex.excelso.xyz/\"\u003e\n    \u003cimg src=\"https://mailprex.excelso.xyz/logo.webp\" alt=\"Mailprex Logo\" width=\"200\" height=\"200\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003eMailprex | Hook \u0026 Docs to MAILPREX\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n Send Emails from your Website with Ease\n  \u003cbr\u003e\n  \u003ca href=\"https://docs.mailprex.excelso.xyz/\"\u003e\u003cstrong\u003eExplore Mailprex docs »\u003c/strong\u003e\u003c/a\u003e\n  \u003ca href=\"https://mailprex.excelso.xyz/\"\u003e\u003cstrong\u003eExplore Mailprex web »\u003c/strong\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/nitdraig/mailprex-app/issues\"\u003eReport bug\u003c/a\u003e\n  ·\n  \u003ca href=\"https://github.com/nitdraig/mailprex-app/issues\"\u003eRequest feature\u003c/a\u003e\n  ·\n  \u003ca href=\"https://agustin.top/\"\u003eCreator Portfolio\u003c/a\u003e\n\u003c/p\u003e\n\n# Mailprex\n\n[![npm version](https://img.shields.io/npm/v/mailprex.svg?style=flat-square)](https://www.npmjs.com/package/mailprex)\n[![npm downloads](https://img.shields.io/npm/dm/mailprex.svg?style=flat-square)](https://www.npmjs.com/package/mailprex)\n\n`Mailprex` is a React hook for handling contact forms and sending data to a server using fetch. This hook simplifies managing the form state and server response.\n\n## What is Mailprex?\n\nMailprex is a service designed to facilitate sending emails from web forms. It handles the backend processes, allowing you to focus on creating and managing your forms without worrying about the complexities of email delivery.\n\n## Installation\n\nFirst, install the package using npm:\n\n```bash\nnpm install mailprex\n\n```\n\n## Usage\n\n- Register in `https://mailprex.excelso.xyz/`, Confirm your account\n- Login in `https://mailprex.excelso.xyz/`, Get a formToken in dashboard\n- Install the hook in your project and **Enjoy**\n\nHere is an example of how to use useMailprex in a contact form component in a react.js application.\n\n```bash\n\"use client\";\nimport React from \"react\";\nimport { useMailprex } from \"mailprex\";\n\nconst ContactForm = () =\u003e {\n  const webName = \"Mailprex Test\";\n  const emailDestiny = \"example@example.com\";\n  const url = \"https://api.mailprex.excelso.xyz/email/send\";\n  const formToken = \"your-form-token\";\n\n  const { formData, handleChange, handleSubmit, response } = useMailprex({\n    url,\n    webName,\n    emailDestiny,\n    formToken,\n  });\n   const handleFormSubmit = async (e) =\u003e {\n    e.preventDefault();\n    await handleSubmit(e);\n    if (response.error) {\n      alert(\n    \"Error sending message. Try again later.\",\n            );\n    } else {\n       alert(\n        \"Message sent succesfully!\"\n         );\n    }\n  };\n\n  return (\n    \u003cform\n      onSubmit={handleFormSubmit}\n      className=\"max-w-lg mx-auto p-4 bg-white shadow-md rounded-lg\"\n    \u003e\n      \u003cdiv className=\"mb-4\"\u003e\n        \u003clabel\n          htmlFor=\"fullname\"\n          className=\"block text-gray-700 font-semibold mb-2\"\n        \u003e\n          Full Name *\n        \u003c/label\u003e\n        \u003cinput\n          type=\"text\"\n          id=\"fullname\"\n          name=\"fullname\"\n          value={formData.fullname}\n          onChange={handleChange}\n          className=\"w-full px-3 py-2 border rounded-md focus:outline-none focus:ring focus:border-blue-300\"\n          placeholder=\"Full name\"\n          required\n        /\u003e\n      \u003c/div\u003e\n      \u003cdiv className=\"mb-4\"\u003e\n        \u003clabel\n          htmlFor=\"email\"\n          className=\"block text-gray-700 font-semibold mb-2\"\n        \u003e\n          Email *\n        \u003c/label\u003e\n        \u003cinput\n          type=\"email\"\n          id=\"email\"\n          name=\"email\"\n          value={formData.email}\n          onChange={handleChange}\n          className=\"w-full px-3 py-2 border rounded-md focus:outline-none focus:ring focus:border-blue-300\"\n          placeholder=\"Email\"\n          required\n        /\u003e\n      \u003c/div\u003e\n      \u003cdiv className=\"mb-4\"\u003e\n        \u003clabel\n          htmlFor=\"phone\"\n          className=\"block text-gray-700 font-semibold mb-2\"\n        \u003e\n          Phone\n        \u003c/label\u003e\n        \u003cinput\n          type=\"tel\"\n          id=\"phone\"\n          name=\"phone\"\n          value={formData.phone}\n          onChange={handleChange}\n          className=\"w-full px-3 py-2 border rounded-md focus:outline-none focus:ring focus:border-blue-300\"\n          placeholder=\"Phone\"\n        /\u003e\n      \u003c/div\u003e\n      \u003cdiv className=\"mb-4\"\u003e\n        \u003clabel\n          htmlFor=\"service\"\n          className=\"block text-gray-700 font-semibold mb-2\"\n        \u003e\n          Service\n        \u003c/label\u003e\n        \u003cinput\n          type=\"text\"\n          id=\"service\"\n          name=\"service\"\n          value={formData.service}\n          onChange={handleChange}\n          className=\"w-full px-3 py-2 border rounded-md focus:outline-none focus:ring focus:border-blue-300\"\n          placeholder=\"Service\"\n        /\u003e\n      \u003c/div\u003e\n      \u003cdiv className=\"mb-4\"\u003e\n        \u003clabel\n          htmlFor=\"message\"\n          className=\"block text-gray-700 font-semibold mb-2\"\n        \u003e\n          Message *\n        \u003c/label\u003e\n        \u003ctextarea\n          id=\"message\"\n          name=\"message\"\n          value={formData.message}\n          onChange={handleChange}\n          className=\"w-full px-3 py-2 border rounded-md focus:outline-none focus:ring focus:border-blue-300\"\n          rows={4}\n          placeholder=\"Message\"\n          required\n        \u003e\u003c/textarea\u003e\n      \u003c/div\u003e\n      \u003cdiv className=\"text-center\"\u003e\n        \u003cbutton\n          type=\"submit\"\n          className=\"bg-blue-500 hover:bg-blue-600 text-white font-semibold px-4 py-2 rounded-md transition-colors duration-300\"\n        \u003e\n          Send Message\n        \u003c/button\u003e\n      \u003c/div\u003e\n      {response.loading \u0026\u0026 (\n        \u003cp className=\"mt-4 text-blue-500\"\u003eSending email...\u003c/p\u003e\n      )}\n      {response.error \u0026\u0026 (\n        \u003cp className=\"mt-4 text-red-500\"\u003e\n          Error sending email: {response.error.message}\n        \u003c/p\u003e\n      )}\n      {response.data \u0026\u0026 (\n        \u003cp className=\"mt-4 text-green-500\"\u003e{response.data.message}\u003c/p\u003e\n      )}\n    \u003c/form\u003e\n  );\n};\n\nexport default ContactForm;\n```\n\n## Example Email\n\n### Here is an example of how the emails sent through Mailprex will appear when they arrive at the specified email address:\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"\"\u003e\n    \u003cimg src=\"https://res.cloudinary.com/draig/image/upload/v1717624258/mailprex/uvc7mvn49rlrpzpeq3vj.png\" alt=\"Example Email\" width=\"700\" height=\"300\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n# API\n\n## useMailprex\n\n### Parameters\n\n- **url:** The server URL to send the form data to.\n- **webName:** The name of the website from which the form is being submitted.\n- **emailDestiny:** The destination email address.\n- **formToken:** The form token for authentication.\n\n### Returns\n\n- **formData:** An object containing the form data.\n- **handleChange:** A function to handle changes in the form fields.\n- **handleSubmit:** A function to handle form submission.\n- **response:** An object containing data, loading, and error regarding the API response.\n\n## Contributing\n\n**_Contributions are welcome. Please open an issue or a pull request for any improvements or fixes._**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitdraig%2Fmailprex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitdraig%2Fmailprex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitdraig%2Fmailprex/lists"}