1 |
|
2 |
|
3 | import { NativeModules } from 'react-native';
|
4 |
|
5 | const { ExponentMailComposer } = NativeModules;
|
6 |
|
7 | type ComposeOptions = {
|
8 | recipients?: string[],
|
9 | ccRecipients?: string[],
|
10 | bccRecipients?: string[],
|
11 | subject?: string,
|
12 | body?: string,
|
13 | isHtml?: boolean,
|
14 | attachments?: string[],
|
15 | };
|
16 |
|
17 | type Status = 'sent' | 'saved' | 'cancelled';
|
18 |
|
19 | type Result = {
|
20 | status: Status,
|
21 | };
|
22 |
|
23 | export async function composeAsync(options: ComposeOptions): Promise<Result> {
|
24 | return ExponentMailComposer.composeAsync(options);
|
25 | }
|