Scenario: Backend(rails) is outputting Json, android app is consuming json.
In the app, I need to open Gmail client(through deep linking) with json data from back end, such that the data is an email text and it has new lines in it. here is what i tried doing:
I tried sending with new line characters in my view(using jbuilder):
json.email "Hey Friend, <%= "\r\n"%> Some text <%= "\r\n"%> Cheers! <%= "\r\n"%> Have a great day! "
json output
"email": "Hey Friend, Some text Cheers! Have a great day!"
I tried sending html:
json.email: "<html><head></head><body>Hey Friend, <br/> <br/>Some text <br/> Cheers! <br/> Have a great day! <br/> </body></html>"
json output
"email": "<html><head></head><body>Hey Friend, <br/> <br/>Some text <br/> Cheers! <br/> Have a great day! <br/> </body></html>"
which when gets consumed at gmail client outputs exact html.
Desired Output:
Hey Friend,
Some Text
Cheers!
Have a great day!
Any help will be appreciated!