tschoffelen / react-native-email-link

📭 Open an email client from React Native (for 'magic link' type functionality).
MIT License
409 stars 74 forks source link

Open the mail app on the compose screen #31

Closed cesar3030 closed 5 years ago

cesar3030 commented 5 years ago

Goal

Being able to open the mail app to the compose screen and optionally provide to, cc, bcc, subject and body.

State

It has only been implemented for iOS so far. I've tested it on my iPhone 7 device with Gmail and Apple Mail. It's working as expected.

Whats new??

I added new attributes to the options argument of openInbox().

param required default description
compose no false When set to true, it will force the app to open on the compose screen even if you do not provide any of the following attributes: to, cc, bcc, subject or body. If you do provide at least one of these attributes, the app will by default be opened on the compose screen so no need to set this attribute to true in this case.
to no undefined The email of the recipient.
cc no undefined The email of the cc.
bcc no undefined The email of the bcc.
subject no undefined The email subject.
body no `undefined The email body.

Remaining work

Recordings

Apple Mail

apple-mail

Gmail

gmail

cesar3030 commented 5 years ago

If someone could help with testing spark, outlook, Airmail and Inbox that would be really nice.

Is Google Inbox app still available? I think I was forced to stop using it :grimacing:

tschoffelen commented 5 years ago

This looks great!

I’m just wondering whether it makes more sense to expose this functionality in a new function, something like openComposer to sit alongside openInbox. Thoughts?

cesar3030 commented 5 years ago

You're totally right. I will fix that asap.

tschoffelen commented 5 years ago

How do you feel about merging it?

Does it feel like it might make more sense to wait for an Android version to be added for the openComposer() function, or release it as is?

In that last case, only two more notes from me:

cesar3030 commented 5 years ago

I was waiting for your friend to review the typescript part. I don't want to break things...

I think we should release it as is. If people start using the openComposer function and like it, that might encourage others to put in a PR for the android version.

I'm fixing the double quote issue and updating the README then feel free to merge it.

cesar3030 commented 5 years ago

I rebased my fork branch on your master branch to fix some merge issues. I will test it tonight just to make sure nothing broke otherwise it's ready to be merged.

cesar3030 commented 5 years ago

I fixed a Typo in the index.d.ts file and now it's working as expected. I tested it on iPhone 7 with Mail and GMail apps.