{"id":20132380,"url":"https://github.com/stephtr/mailchannels-react-email","last_synced_at":"2025-10-07T16:07:37.129Z","repository":{"id":233393432,"uuid":"787008387","full_name":"stephtr/mailchannels-react-email","owner":"stephtr","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-16T00:34:20.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T01:36:41.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/stephtr.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-04-15T18:03:02.000Z","updated_at":"2024-04-15T18:03:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"785cf031-58c1-4b82-bbf9-757c64005066","html_url":"https://github.com/stephtr/mailchannels-react-email","commit_stats":null,"previous_names":["stephtr/mailchannels-react-email"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stephtr/mailchannels-react-email","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fmailchannels-react-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fmailchannels-react-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fmailchannels-react-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fmailchannels-react-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephtr","download_url":"https://codeload.github.com/stephtr/mailchannels-react-email/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fmailchannels-react-email/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278803243,"owners_count":26048658,"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-10-07T02:00:06.786Z","response_time":59,"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":[],"created_at":"2024-11-13T20:53:23.401Z","updated_at":"2025-10-07T16:07:37.075Z","avatar_url":"https://github.com/stephtr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mailchannels-react-email\n\nThis package provides a simple interface for integrating MailChannels in your app, with optional support for [react-email](https://react.email/). It supports development mode logging and seamless DKIM signing.\n\n## Features\n\n- Full support for MailChannels features\n- Optional integration for [react-email](https://react.email/)\n- Development mode for fast testing (console)\n- Environment-based or explicit DKIM configuration\n\n## Installation\n\n```bash\nnpm install mailchannels-react-email\n```\n\n## Quick Start\n\nFor how to set up Mailchannels with Cloudflare, see [their documentation](https://developers.cloudflare.com/pages/functions/plugins/mailchannels/#enable-mailchannels-for-your-account---domain-lockdown).\n\n### Sending Basic Emails\n\n```js\nimport sendEmail from \"mailchannels-react-email\";\n\ntry {\n  await sendEmail({\n    subject: \"Test email\",\n    text: \"This is a test email\",\n    from: { name: \"John Doe\", email: \"john@example.com\" },\n    to: \"smith@example.com\",\n  });\n} catch (e) {\n  console.error(`Error sending the mail: ${e.message}`);\n}\n```\n\n### Using React Components for Emails\n\n```js\nimport sendEmail from \"mailchannels-react-email/react-email\";\nimport TestEmail from \"./testmail\";\n\ntry {\n  await sendEmail(\u003cTestEmail /\u003e, {\n    subject: \"Test email\",\n    from: { name: \"John Doe\", email: \"john@example.com\" },\n    to: { email: \"smith@example.com\" },\n  });\n} catch (e) {\n  console.error(`Error sending the mail: ${e.message}`);\n}\n```\n\n## API Reference\n\n### DKIM\n\nMailchannels supports signing your emails using DKIM. You can either supply the dkim domain, selector and private key, or just provide them as environment variables `DKIM_DOMAIN`, `DKIM_SELECTOR`, `DKIM_PRIVATE_KEY`, which will be automatically picked up.\n\n### Email options\n\n```ts\ntype EmailOptions = {\n  subject: string;\n  text: string;\n  html?: string;\n  from: MailContact;\n  to: MailContacts;\n  cc?: MailContacts;\n  bcc?: MailContacts;\n  replyTo?: MailContact;\n  dkim?: {\n    domain: string;\n    selector: string;\n    privateKey: string;\n  };\n  attachments?: Array\u003cAttachment\u003e;\n};\n\ntype MailContact = string | { name?: string; email: string };\ntype MailContacts = MailContact | Array\u003cMailContact\u003e;\n\ntype Attachment = {\n  contentType: string;\n  filename: string;\n  content: Buffer | ArrayBuffer | string; // base64 encoded string\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephtr%2Fmailchannels-react-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephtr%2Fmailchannels-react-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephtr%2Fmailchannels-react-email/lists"}