{"_id":"@beantech-designs/contact-form","_rev":"2-688b68de0577121ba65d9ad1088131d4","name":"@beantech-designs/contact-form","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.1":{"name":"@beantech-designs/contact-form","version":"1.0.1","description":"A react hook for handling beantech's contact us mailing","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest","eslint:fix":"eslint src --fix","build":"tsc","prepare":"npm run build","prepublishOnly":"npm test && npm run eslint:fix","preversion":"npm run eslint:fix","version":"git add -A src","postversion":"git push && git push --tags"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.ts":["npm run eslint:fix","git add"]},"repository":{"type":"git","url":"git+https://github.com/Bobslegend61/contact-form.git"},"keywords":["contact","contact-form","hook","contact-us"],"author":{"name":"Beantech Inc."},"license":"MIT","bugs":{"url":"https://github.com/Bobslegend61/contact-form/issues"},"homepage":"https://github.com/Bobslegend61/contact-form#readme","devDependencies":{"@testing-library/jest-dom":"^5.16.2","@testing-library/react-hooks":"^7.0.2","@types/axios":"^0.14.0","@types/jest":"^27.4.0","@types/react":"^17.0.39","@types/yup":"^0.29.13","@typescript-eslint/eslint-plugin":"^5.11.0","@typescript-eslint/parser":"^5.11.0","eslint":"^8.9.0","eslint-plugin-react":"^7.28.0","husky":"^7.0.4","jest":"^27.5.1","lint-staged":"^12.3.3","msw":"^0.36.8","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","ts-jest":"^27.1.3","typescript":"^4.5.5"},"dependencies":{"axios":"^0.25.0","formik":"^2.2.9","yup":"^0.32.11"},"gitHead":"fc20b1199805d42427b77fa5e4f9b1a0a629fd34","_id":"@beantech-designs/contact-form@1.0.1","_nodeVersion":"14.18.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-DFqOT+m0HjiKzT49MyXcYclbiG4/Th8TFCKoei6kuzWxqTl/ouHgtPqp/JI5l0k65kt32UVqyS5QDRMjP6G/hQ==","shasum":"fce597e20c05dc6f24c4776981059faae99051f2","tarball":"https://registry.npmjs.org/@beantech-designs/contact-form/-/contact-form-1.0.1.tgz","fileCount":8,"unpackedSize":16864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGfsfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1Ew//RtPuqVdRvd3efT1gMrLK/xJi7ntn1IeSGRfZ250gKY3GREyS\r\nobGd6b/Q/17l2veMZMXBd2V1s+gUvdKrk0+wYlEimGiq05a3Encw1l2Tz3sq\r\nsYeDslaR5F/3fboKSQHy/tVIINKmLvHSdCTcn9NyXIiVPA7TN+/I4tC1XJ8i\r\nxezJhJInDAJYyq3Kcq6rmD8CiIrJWk72OuKJfJDySCQeyESJ4OvC53abdzA4\r\njNz4SkshIUKYHdFDjOUHMXIsyEzlbwZekCexildcf2XpnwfpMG4SFFZZmaAV\r\nBCRw4053WS/jkHFnR/xZ8Qm9vJD6OfdGIW/tjv4J1xwuEyLMeEAYH325QP9Z\r\nzbC/vErhvXRf/jSj4+TrYB+YiBDQLKSVPiPfJlViRoK2UFqtQjiGv4+KGqb2\r\n7fONs3qJlxyV6JQET5zCR1QtJCXd1r1t4W5SnTrFGu5qF45Psn83tjiXk0EU\r\n8+xOVJ9D0hR7oqfOvTUoU2idy6Hv3EDOnRgMl9vzlOciwMENszD/cZPF+oYX\r\nzg3kIPgQxo7i6BabAkIWvSfIhmT9m7tvevITCClwVBJoTY+1oZsA0MMYL5vQ\r\n3GN7F9XBMQHj73Zl6JtVB9eHmiLOzOYCLXJdtz1nQwJ4vPWikbTCzIZ9ltSh\r\nuyycOxPiLnEnE51dJlDIOf1nHniSpIL86jA=\r\n=sXKi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmiXtXbCoQPawSMgy5nxBVklcS7ujs0bbQX+kjaarvZAiB/2dciAU9rsdrNNKhapawO9vlRgUkEmQj0b8WLdr+8KA=="}]},"_npmUser":{"name":"beantech-designs","email":"beantech.designs@gmail.com"},"directories":{},"maintainers":[{"name":"beantech-designs","email":"beantech.designs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/contact-form_1.0.1_1645869855597_0.5731517433621742"},"_hasShrinkwrap":false},"2.0.0":{"name":"@beantech-designs/contact-form","version":"2.0.0","description":"A react hook for handling beantech's contact us mailing","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest","eslint:fix":"eslint src --fix","build":"tsc","prepare":"npm run build","prepublishOnly":"npm test && npm run eslint:fix","preversion":"npm run eslint:fix","version":"git add -A src","postversion":"git push && git push --tags"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.ts":["npm run eslint:fix","git add"]},"repository":{"type":"git","url":"git+https://github.com/Bobslegend61/contact-form.git"},"keywords":["contact","contact-form","hook","contact-us"],"author":{"name":"Beantech Inc."},"license":"MIT","bugs":{"url":"https://github.com/Bobslegend61/contact-form/issues"},"homepage":"https://github.com/Bobslegend61/contact-form#readme","devDependencies":{"@testing-library/jest-dom":"^5.16.2","@testing-library/react-hooks":"^7.0.2","@types/axios":"^0.14.0","@types/jest":"^27.4.0","@types/react":"^17.0.39","@types/yup":"^0.29.13","@typescript-eslint/eslint-plugin":"^5.11.0","@typescript-eslint/parser":"^5.11.0","eslint":"^8.9.0","eslint-plugin-react":"^7.28.0","husky":"^7.0.4","jest":"^27.5.1","lint-staged":"^12.3.3","msw":"^0.36.8","react":"^17.0.2","react-dom":"^17.0.2","react-test-renderer":"^17.0.2","ts-jest":"^27.1.3","typescript":"^4.5.5"},"dependencies":{"axios":"^0.25.0","formik":"^2.2.9","yup":"^0.32.11"},"gitHead":"d5a1a513f9eeedaf0d9a35a8903c73a96a7e8f7f","_id":"@beantech-designs/contact-form@2.0.0","_nodeVersion":"14.18.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-TKcpvNdAhSixP4UXyq91mSc09XZ9+H65yQYNGT8QoLrNLyrd7dn1I2ibTeV95JM2ERX3WQgnaN9nIYbJLZ73MA==","shasum":"da109237ca21b0b281f20d909666f375097fe66d","tarball":"https://registry.npmjs.org/@beantech-designs/contact-form/-/contact-form-2.0.0.tgz","fileCount":8,"unpackedSize":18004,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiG9OSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSlA//XUlByGVAyHL/+yE9njkDyGTennXhh6LvKRA+/SpjV2oB7I8d\r\nPd1NeSCAGeB4E6cp1/2BJQ9PpZ6GPFJ9acB3V31ruHGy9Bly63wIoVaxYAou\r\n6WWuMsUtmaLa0r3KT2tW29dq9bMZW98HVR0kpzPKFTy7dcHGq3tUogEAyYKH\r\nvyilzt3lehFfmG8djJWT2s/HG4gLLhCIe5+EROH51gUZ3ZdaUvDKdhDTYBdF\r\nZ0TyGUrfHF9DLoK6KY+XgWd7jMTdt8Ae4rsrvqNHVCrqs2ajjn0r+IfWGw+d\r\nR+JsyghU1QHKjw2R7DAtWuMqiMO9iiw329DT3QFGPH3UHTpAboGWrrp1yBgn\r\nCWRxeQy0TE9bqbminKim72eAB1KtQl6CQpu698CpAZcp9ifPUnmgJRK6r8P0\r\n7dnmno2cd5mYKMmFndNXgcNf9t3pk1lHTDqdOQ3t2BWZCK2lsHxzHc6pMSrf\r\n73+dzfcj7qv5t6OADqtAhRGP6C3PkchK0g3uH9g7j4KDt1IWICZ2oiL3kecS\r\ncZnlNCHazMVK96X4qeK2oCXLU6ZMYfY+6MZl4+aQo+pAmSHp51fq5dpFFU8f\r\nzDhWs0HqIDAnZ26divh4KP+b+ItM769t/Z1VRUCt6UQmNh5QThqYfgbfmXrR\r\nGHMog/BqKiB2ca8qjsFiYSURfrY8CvoXqPw=\r\n=g6yK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBol+pSJmzDSm6V5hKdKHWyF1Oaisy73wfrg6oS6N4QuAiEAmuAy6jCkApUkmOnSjNiliULrkHCBYtNUOtCgTeTI1co="}]},"_npmUser":{"name":"beantech-designs","email":"beantech.designs@gmail.com"},"directories":{},"maintainers":[{"name":"beantech-designs","email":"beantech.designs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/contact-form_2.0.0_1645990802434_0.6848876281908951"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-26T10:04:15.538Z","1.0.1":"2022-02-26T10:04:15.746Z","modified":"2022-04-04T18:06:03.296Z","2.0.0":"2022-02-27T19:40:02.620Z"},"maintainers":[{"name":"beantech-designs","email":"beantech.designs@gmail.com"}],"description":"A react hook for handling beantech's contact us mailing","homepage":"https://github.com/Bobslegend61/contact-form#readme","keywords":["contact","contact-form","hook","contact-us"],"repository":{"type":"git","url":"git+https://github.com/Bobslegend61/contact-form.git"},"author":{"name":"Beantech Inc."},"bugs":{"url":"https://github.com/Bobslegend61/contact-form/issues"},"license":"MIT","readme":"# Beantech Contact Form\n\nA custom hook for handling contact form submission.\n\n# Installing\n\nUsing npm:\n\n```\n$ npm install @beantech-designs/contact-form\n```\n\n## Example\n\n```jsx\nimport { useContactForm } from \"@beantech-designs/contact-form\";\n\nconst ContactForm = () => {\n  const onSuccess = (data) => {\n    console.log(data);\n  };\n\n  const onError = (error) => {\n    console.log(error);\n  };\n\n  const options = {\n    url: \"http://www.domain.com\",\n    companyEmailAddress: \"companyEmail@company.com\",\n    onSuccess,\n    onError,\n    template: (email, fullName, message) => `<h1>Name: ${fullName}</h1>\n                                              <h2>Email: ${email}</h2>\n                                              <p>${message}</p>\n                                            `,\n  };\n\n  const { form } = useContactForm(options);\n  return (\n    <form onSubmit={form.handleSubmit}>\n      // fullName\n      <div>\n        <input\n          type=\"text\"\n          name=\"fullName\"\n          onChange={form.handleChange}\n          value={form.values.fullName}\n        />\n        // validation error message\n        {form.touched.fullName && form.errors.fullName ? (\n          <div>{form.errors.fullName}</div>\n        ) : null}\n      </div>\n      // Email\n      <div>\n        <input\n          type=\"email\"\n          name=\"email\"\n          onChange={form.handleChange}\n          value={form.values.email}\n        />\n        // validation error message\n        {form.touched.email && form.errors.email ? (\n          <div>{form.errors.email}</div>\n        ) : null}\n      </div>\n      // subject\n      <div>\n        <input\n          type=\"text\"\n          name=\"subject\"\n          onChange={form.handleChange}\n          value={form.values.subject}\n        />\n        // validation error message\n        {form.touched.subject && form.errors.subject ? (\n          <div>{form.errors.subject}</div>\n        ) : null}\n      </div>\n      // message\n      <div>\n        <textarea\n          name=\"message\"\n          onChange={form.handleChange}\n          value={form.values.message}\n        ></textarea>\n        // validation error message\n        {form.touched.message && form.errors.message ? (\n          <div>{form.errors.message}</div>\n        ) : null}\n      </div>\n      <input type=\"submit\" value=\"Submit\" disabled={form.isSubmitting} />\n    </form>\n  );\n};\n```\n\n#### useContactForm(options)\n\n`options`\n\n- `url`: _required_ - Mail server endpoint.\n- `companyEmailAddress`: _required_ - Email address of the host company.\n- `onSuccess`: _required_ - Function to be called if email was successfully sent.\n- `onError`: _required_ - Function to be called if an error occured when sending email.\n- `template`: _optional_ - HTML template to render as email template.\n","readmeFilename":"README.md"}