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

Line breaks in "body" doesn't seem to work #74

Closed psyzz closed 4 years ago

psyzz commented 4 years ago

Hello,

thanks for your great lib, i'm using it to open the user favorite email client. With Apple Mail line breaks are taken into account, but with GMAIL it is not.

Do you have any idea why and/or where can i search to this feature ?

Thank you, Regards.

tschoffelen commented 4 years ago

Hi, thanks for using the library!

I don't think email subjects generally support line breaks.

psyzz commented 4 years ago

Hi, thanks for using the library!

I don't think email subjects generally support line breaks.

Oh yes sorry i meant « body ».

tschoffelen commented 4 years ago

Ah, I see. I think you need to use \r\n, as per this StackOverflow comment:

https://stackoverflow.com/questions/22765834/insert-a-line-break-in-mailto-body#comment60488593_25634014

psyzz commented 4 years ago

Thanks for the link, i tried \r\n , \n\n , <br/>, <br> but gmail don't seem to take them into account. The body string in the Gmail mobile app shows the string \r\n, \n\n, etc

MaxAtkinson commented 4 years ago

@psyzz Having the same issue with GMail client.

psyzz commented 4 years ago

I did not found any solution :(

tschoffelen commented 4 years ago

It seems like this might just be a limitation of mobile Gmail unfortunately...

I don't know if there's any channel for support on Google's side?

kei95 commented 4 years ago

It is quite late but for people using the older version than 1.9.2, you can solve the problem by updating the dependency to the latest version. However, the bug still happens if you set encodeBody to true.

By looking at the commit https://github.com/flexible-agency/react-native-email-link/commit/11b1fec2af3dcaf5c31cc2c54721ba1b91a873d8, it looks like encodeURIComponent is making this behaviour, so I recommend you to use openComposer without enablingencodeBody for now.

ArekChr commented 3 years ago

It is quite late but for people using the older version than 1.9.2, you can solve the problem by updating the dependency to the latest version. However, the bug still happens if you set encodeBody to true.

By looking at the commit 11b1fec, it looks like encodeURIComponent is making this behaviour, so I recommend you to use openComposer without enablingencodeBody for now.

Still doesn't work

craigcoles commented 2 years ago

This is not an issue with this package, but a change that was made to how iOS handles mailto links:

Support for rich content, such as HTML, has been removed for mailto links from iOS 14.6+. Please see the following support document for further information on security fixes made in iOS 14.6: https://support.apple.com/en-us/HT212528

Source: https://developer.apple.com/forums/thread/681023?answerId=678880022#678880022