Writing Texts In The Body Of The Sent Email One Under The Other -react Native
I'm new to React native and javascript. In the application, I created a screen for the user to email me their thoughts. All the texts in the body text of the mail stand side by sid
Solution 1:
You could use the \n
newline character in your template literal.
const [comment, setComment] = useState('');
const brand = DeviceInfo.getBrand(); // Sonyconst model = DeviceInfo.getModel(); // G8341const systemName = DeviceInfo.getSystemName(); // Androidconst systemVersion = DeviceInfo.getSystemVersion(); // 9const emailAddresses = [
'example@gmail.com',
'example2@gmail.com',
];
const to = emailAddresses.join(',');
const subject = 'Error';
const body = `${brand}${model}\n${systemName}${systemVersion}\n${comment}`;
const url = `mailto:${to}?subject=${subject}&body=${body}`;
// …
For a Comments here
comment, this will create a new email, ready to be sent to both example@gmai.com
and example2@gmai.com
, with a subject of Error
and the following body.
Body:
Sony G8341
Android 9
Comments here
Here's a somewhat simplified snack (check the components/EmailComposer.js
file)
Post a Comment for "Writing Texts In The Body Of The Sent Email One Under The Other -react Native"