{"id":19355642,"url":"https://github.com/tschoffelen/react-native-email-link","last_synced_at":"2025-05-15T15:08:38.300Z","repository":{"id":37980527,"uuid":"123154520","full_name":"tschoffelen/react-native-email-link","owner":"tschoffelen","description":"📭 Open an email client from React Native (for 'magic link' type functionality).","archived":false,"fork":false,"pushed_at":"2025-03-11T09:38:57.000Z","size":578,"stargazers_count":421,"open_issues_count":4,"forks_count":76,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T20:06:36.556Z","etag":null,"topics":["email","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/tschoffelen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"tschoffelen"}},"created_at":"2018-02-27T16:11:15.000Z","updated_at":"2025-03-28T18:54:23.000Z","dependencies_parsed_at":"2024-06-29T17:39:03.395Z","dependency_job_id":"050f7ee1-c8de-4b1c-8597-df175f069d53","html_url":"https://github.com/tschoffelen/react-native-email-link","commit_stats":{"total_commits":153,"total_committers":35,"mean_commits":4.371428571428571,"dds":0.5816993464052287,"last_synced_commit":"f34cc05603a6fdb206ba970c3bd600c1b4e4be5f"},"previous_names":["flexible-agency/react-native-email-link","tschoffelen/react-native-email-link","includable/react-native-email-link"],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschoffelen%2Freact-native-email-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschoffelen%2Freact-native-email-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschoffelen%2Freact-native-email-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschoffelen%2Freact-native-email-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tschoffelen","download_url":"https://codeload.github.com/tschoffelen/react-native-email-link/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247730068,"owners_count":20986404,"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":["email","react-native"],"created_at":"2024-11-10T06:03:08.663Z","updated_at":"2025-04-07T21:11:06.619Z","avatar_url":"https://github.com/tschoffelen.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tschoffelen"],"categories":[],"sub_categories":[],"readme":"# React Native Email Link\n\n[![GitHub release](https://img.shields.io/npm/v/react-native-email-link.svg)](https://www.npmjs.com/package/react-native-email-link)\n[![NPM](https://img.shields.io/npm/dm/react-native-email-link.svg)](https://www.npmjs.com/package/react-native-email-link)\n[![GitHub license](https://img.shields.io/github/license/flexible-agency/react-native-email-link.svg)](https://github.com/flexible-agency/react-native-email-link/blob/master/LICENSE)\n\n---\n\nAn easy way to open an email app of the user's choice, based on the mail apps they have installed\non their device. Very helpful for magic link logins.\n\nCurrently supported apps:\n\n- Apple Mail\n- Gmail\n- Inbox\n- Spark\n- Airmail\n- Outlook\n- Yahoo Mail\n- Superhuman\n- Yandex\n- ProtonMail\n- Fastmail\n\n## Installation\n\n### 1. Install the package\n\n```\nyarn add react-native-email-link\n```\n\nThis package works with autolinking on RN\u003e=0.60. If you're using an earlier version of React Native, please install version `1.4.0` of the library, or\ncheck out the legacy [rnpm](https://github.com/leanmotherfuckers/react-native-email-link/tree/rnpm) branch.\n\n### 2. Post-install steps\n\nBased on the platforms your app supports, you also need to:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eiOS – Update Info.plist\u003c/strong\u003e\u003c/summary\u003e\n\nTo allow your app to detect if any of the mailbox apps are installed, an extra step is required on iOS. Your app needs to provide the `LSApplicationQueriesSchemes` key inside `ios/{my-project}/Info.plist` to specify the URL schemes with which the app can interact.\n\nJust add this in your `Info.plist` depending on which apps you'd like to support. Omitting these might mean that the library can't detect some of the mail apps installed by the user.\n\n```xml\n\u003ckey\u003eLSApplicationQueriesSchemes\u003c/key\u003e\n\u003carray\u003e\n    \u003cstring\u003emailto\u003c/string\u003e\n    \u003cstring\u003emessage\u003c/string\u003e\n    \u003cstring\u003ereaddle-spark\u003c/string\u003e\n    \u003cstring\u003eairmail\u003c/string\u003e\n    \u003cstring\u003ems-outlook\u003c/string\u003e\n    \u003cstring\u003egooglegmail\u003c/string\u003e\n    \u003cstring\u003einbox-gmail\u003c/string\u003e\n    \u003cstring\u003eymail\u003c/string\u003e\n    \u003cstring\u003esuperhuman\u003c/string\u003e\n    \u003cstring\u003eyandexmail\u003c/string\u003e\n    \u003cstring\u003efastmail\u003c/string\u003e\n    \u003cstring\u003eprotonmail\u003c/string\u003e\n    \u003cstring\u003eszn-email\u003c/string\u003e\n\u003c/array\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eExpo – Enable Config Plugin\u003c/strong\u003e\u003c/summary\u003e\n\nTo allow the library to work with Expo you need to enable the [config plugin](https://docs.expo.dev/guides/config-plugins/). This plugin will automatically configure your Expo application with the correct settings for this library to function.\n\nTo enable the config plugin, add it to the `plugins` array inside your `app.config.js`/`app.config.json`. For example:\n\n```json\n{\n  \"name\": \"my app\",\n  \"plugins\": [\"react-native-email-link\"]\n}\n```\n\nWant this library to work on Android too? Because the library uses native code on Android you need to [follow Expo's guide](https://docs.expo.dev/workflow/customizing/) for custom native code.\n\n\u003c/details\u003e\n\n## Usage\n\n### openInbox\n\n```javascript\nimport { openInbox } from \"react-native-email-link\";\n\nopenInbox();\n```\n\n#### Arguments\n\n- [`title`](#title)\n- [`message`](#message)\n- [`cancelLabel`](#cancelLabel)\n- [`removeText`](#removeText)\n- [`defaultEmailLabel`](#defaultEmailLabel)\n- [`newTask`](#newTask)\n\n#### `title`\n\nText for the top of the ActionSheet or Intent.\n\n| Type   | Required | Default         |\n| ------ | -------- | --------------- |\n| string | No       | 'Open mail app' |\n\n#### `message`\n\nSubtext under the title on the ActionSheet\n\n| Type   | Required | Default                             | Platform |\n| ------ | -------- | ----------------------------------- | -------- |\n| string | No       | 'Which app would you like to open?' | iOS      |\n\n#### `cancelLabel`\n\nText for last button of the ActionSheet.\n\n| Type   | Required | Default  | Platform |\n| ------ | -------- | -------- | -------- |\n| string | No       | 'Cancel' | iOS      |\n\n#### `removeText`\n\nIf true, not text will be show above the ActionSheet or Intent. Default value is false.\n\n| Type    | Required | Default |\n| ------- | -------- | ------- |\n| boolean | No       | false   |\n\n#### `defaultEmailLabel`\n\nText for first button of the ActionSheet.\n\n| Type   | Required | Default                | Platform |\n| ------ | -------- | ---------------------- | -------- |\n| string | No       | 'Default email reader' | iOS      |\n\n#### `newTask`\n\nIf true, the email Intent will be started in a new Android task. Else, the Intent will be launched in the current task.\n\nRead more about Android tasks [here](https://developer.android.com/guide/components/activities/tasks-and-back-stack).\n\n| Type    | Required | Default | Platform |\n| ------- | -------- | ------- | -------- |\n| boolean | No       | true    | Android  |\n\n#### Example\n\n```javascript\nimport { openInbox } from \"react-native-email-link\";\n\nopenInbox({\n  message: \"Whatcha wanna do?\",\n  cancelLabel: \"Go back!\",\n});\n```\n\n### openComposer\n\n```javascript\nimport { openComposer } from \"react-native-email-link\";\n\nopenComposer();\n```\n\n#### Arguments\n\n- [`app`](#app)\n- [`title`](#title)\n- [`message`](#message) (iOS only)\n- [`cancelLabel`](#cancelLabel) (iOS only)\n- [`removeText`](#removeText)\n- [`defaultEmailLabel`](#defaultEmailLabel)\n- [`to`](#to)\n- [`cc`](#cc)\n- [`bcc`](#bcc)\n- [`subject`](#subject)\n- [`body`](#body)\n- [`encodeBody`](#encodeBody)\n\n#### `app`\n\nApp to open the composer with\n\n| Type   | Required | Example                                                       |\n| ------ | -------- | ------------------------------------------------------------- |\n| string | No       | An app's `id` that can be retrieved with `getEmailClients`    |\n|        |          | On Android - `id` holds the package name, e.g. `com.mail.app` |\n|        |          | On iOS - `id` holds the app slug/name, e.g. `gmail`           |\n\n#### `title`\n\nText for the top of the ActionSheet or Intent.\n\n| Type   | Required | Default         |\n| ------ | -------- | --------------- |\n| string | No       | 'Open mail app' |\n\n#### `message`\n\nSubtext under the title on the ActionSheet.\n\n| Type   | Required | Default                             | Platform |\n| ------ | -------- | ----------------------------------- | -------- |\n| string | No       | 'Which app would you like to open?' | iOS      |\n\n#### `cancelLabel`\n\nText for last button of the ActionSheet.\n\n| Type   | Required | Default  | Platform |\n| ------ | -------- | -------- | -------- |\n| string | No       | 'Cancel' | iOS      |\n\n#### `removeText`\n\nIf true, not text will be show above the ActionSheet or Intent. Default value is false.\n\n| Type    | Required | Default |\n| ------- | -------- | ------- |\n| boolean | No       | false   |\n\n#### `defaultEmailLabel`\n\nText for first button of the ActionSheet.\n\n| Type   | Required | Default                | Platform |\n| ------ | -------- | ---------------------- | -------- |\n| string | No       | 'Default email reader' | iOS      |\n\n#### `to`\n\nRecipient's email address.\n\n| Type   | Required | Default |\n| ------ | -------- | ------- |\n| string | No       | null    |\n\n#### `cc`\n\nEmail's cc.\n\n| Type   | Required | Default |\n| ------ | -------- | ------- |\n| string | No       | null    |\n\n#### `bcc`\n\nEmail's bcc.\n\n| Type   | Required | Default |\n| ------ | -------- | ------- |\n| string | No       | null    |\n\n#### `subject`\n\nEmail's subject.\n\n| Type   | Required | Default |\n| ------ | -------- | ------- |\n| string | No       | null    |\n\n#### `body`\n\nEmail's body.\n\n| Type   | Required | Default |\n| ------ | -------- | ------- |\n| string | No       | null    |\n\n#### `encodeBody`\n\nApply `encodeURIComponent` to the email's body.\n\n| Type    | Required | Default |\n| ------- | -------- | ------- |\n| boolean | No       | false   |\n\n#### Example\n\n```javascript\nimport { openComposer } from \"react-native-email-link\";\n\nopenComposer({\n  to: \"support@example.com\",\n  subject: \"I have a question\",\n  body: \"Hi, can you help me with...\",\n});\n```\n\n### getEmailClients\n\n```javascript\nimport { getEmailClients } from \"react-native-email-link\";\n\nconst clients = await getEmailClients();\n\nconsole.log(clients)[\n  {\n    iOSAppName: \"gmail\", // iOS only\n    prefix: \"gmail://\",\n    title: \"GMail\",\n    androidPackagename: \"com.google.android.gm\", // Android only\n    id: \"gmail\", // depending on the platform, holds either the package name or the app slug value\n  }\n];\n```\n\nTo utilize this feature to display an email client picker within a custom UI and subsequently use the `openComposer` to launch a specific app, you just need to pass the `id` (from response) value into the options (`options.app`) within the `openComposer`.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cb\u003e\n\t\t\u003ca href=\"https://schof.co/consulting/?utm_source=flexible-agency/react-native-email-link\"\u003eGet professional support for this package →\u003c/a\u003e\n\t\u003c/b\u003e\n\t\u003cbr\u003e\n\t\u003csub\u003e\n\t\tCustom consulting sessions available for implementation support or feature development.\n\t\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftschoffelen%2Freact-native-email-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftschoffelen%2Freact-native-email-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftschoffelen%2Freact-native-email-link/lists"}