{"id":22240438,"url":"https://github.com/imgarylai/use-mailchimp-form","last_synced_at":"2025-04-10T10:12:28.961Z","repository":{"id":37049930,"uuid":"262248987","full_name":"imgarylai/use-mailchimp-form","owner":"imgarylai","description":"✉️ MailChimp form react integration implemented in React hooks way. ","archived":false,"fork":false,"pushed_at":"2024-09-17T09:48:22.000Z","size":15105,"stargazers_count":27,"open_issues_count":11,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-17T14:13:15.388Z","etag":null,"topics":["mailchimp","mailchimp-embed","react","react-hooks","reactjs"],"latest_commit_sha":null,"homepage":"","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/imgarylai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-05-08T06:51:38.000Z","updated_at":"2024-08-12T20:01:15.000Z","dependencies_parsed_at":"2023-12-16T01:23:52.913Z","dependency_job_id":"223d6630-5be2-42bc-a328-0ea5c5022bb8","html_url":"https://github.com/imgarylai/use-mailchimp-form","commit_stats":{"total_commits":434,"total_committers":8,"mean_commits":54.25,"dds":0.511520737327189,"last_synced_commit":"1d6ee39cd7faac0416f7bd5ae3ec9529667b92bb"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgarylai%2Fuse-mailchimp-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgarylai%2Fuse-mailchimp-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgarylai%2Fuse-mailchimp-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgarylai%2Fuse-mailchimp-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imgarylai","download_url":"https://codeload.github.com/imgarylai/use-mailchimp-form/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248198888,"owners_count":21063628,"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":["mailchimp","mailchimp-embed","react","react-hooks","reactjs"],"created_at":"2024-12-03T03:58:38.123Z","updated_at":"2025-04-10T10:12:28.941Z","avatar_url":"https://github.com/imgarylai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-mailchimp-form [![npm](https://img.shields.io/npm/v/use-mailchimp-form)](https://www.npmjs.com/package/use-mailchimp-form) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![codecov](https://codecov.io/gh/imgarylai/use-mailchimp-form/branch/main/graph/badge.svg?token=HK9ISNOG26)](https://codecov.io/gh/imgarylai/use-mailchimp-form)\n\nThis package helps you integrate the [MailChimp](https://mailchimp.com/) subscribe form into your React App.\nIt is implemented in the React hooks way to handle the business logic. You can just make your efforts for the view. 😀 The view component can be fully customized or implemented with other React form library.      \n\n## Install\n\n```bash\n$ npm install use-mailchimp-form\n```\nor\n```base\n$ yarn add use-mailchimp-form\n```\n\n## Mailchimp\n\nTo get your mailchimp form post endpoint.\n\n1. Go to the `audience` Page. In the right-hand side, click the dropdown menu, `Manage Audience \u003e Signup Form`.\n2. Select `Embedded Form`. \n3. Inside integration the code, find the form post action url, which is like: `https://aaaaaaaaa.us20.list-manage.com/subscribe/post?u=xxxxxxxxxxxxxxxxxx\u0026amp;id=yyyyyyyyyy`  \n\nWe need this url later. \n  \n## Usage\n\n```jsx\nimport { useFormFields, useMailChimpForm } from \"use-mailchimp-form\";\n\n// The useFormFields is not necessary. You can use your own form component.  \n\nexport default function App() {\n  const url = \"YOUR_SUBSCRIBE_URL\";\n  // The url looks like the url below:\n  // https://aaaaaaaaa.us20.list-manage.com/subscribe/post?u=xxxxxxxxxxxxxxxxxx\u0026amp;id=yyyyyyyyyy\n  const {\n      loading,\n      error,\n      success,\n      message,\n      handleSubmit\n    } = useMailChimpForm(url);\n  const { fields, handleFieldChange } = useFormFields({\n    EMAIL: \"\",\n  });\n  return (\n    \u003cdiv\u003e\n      \u003cform\n        onSubmit={event =\u003e {\n          event.preventDefault();\n          handleSubmit(fields);\n        }}\n      \u003e\n        \u003cinput\n          id=\"EMAIL\"\n          autoFocus\n          type=\"email\"\n          value={fields.EMAIL}\n          onChange={handleFieldChange}\n        /\u003e\n        \u003cbutton\u003esubmit\u003c/button\u003e\n      \u003c/form\u003e\n      {loading \u0026\u0026 \"submitting\"}\n      {error \u0026\u0026 message}\n      {success \u0026\u0026 message}\n    \u003c/div\u003e\n  );\n}\n\n```\n\n## Live Demo\n\n[![Edit use-mailchimp-form](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/use-mailchimp-form-7r3br?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimgarylai%2Fuse-mailchimp-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimgarylai%2Fuse-mailchimp-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimgarylai%2Fuse-mailchimp-form/lists"}