I am new at React Native. I have a modal that has a text input area. I want the comment that the user enters here to be sent directly to my e-mail addresses without opening the gmail application. In other words, the user will enter his comment in this field and will return to the application after pressing the send button. As soon as the send button is pressed, the comment written by the user will be sent to my two e-mail addresses. Is it possible to do this in React Native?
Modal View in App:
My Code:
import React, { useState } from "react"
import { StyleSheet, View, Text, TextInput } from "react-native"
import { colors } from "../../theme/Colors"
import Fonts from "../../theme/Fonts"
import { units } from "../../theme/Units"
import ModalButtonWithBackground from "./ModalButtonWithBackground"
const StoreReview = (props) => {
const [comment, setComment] = useState('')
return (
<View style={styles.container}>
<Text style={styles.headerText}>
We are very sorry about this.
Can you share your experiences?
</Text>
<View style={styles.commentArea}>
<TextInput
onChangeText={setComment}
value={comment}
multiline={true}
/>
</View>
<View style={styles.button}>
<ModalButtonWithBackground
buttonText={'Send'}
onPress={() => {
console.log(comment, 'send this comment by e-mail')
props.onPressCloseModal()
}}
/>
</View>
</View>
)
}
const styles = StyleSheet.create({
container: {
marginTop: units.height / 144,
height: units.height / 2.88,
justifyContent: 'space-between',
},
headerText: {
fontFamily: Fonts.type.bold,
fontSize: Fonts.size(20),
color: colors.WHITE,
textAlign: 'center',
marginHorizontal: units.width / 7.87
},
commentArea: {
width: units.width / 1.13,
height: units.height / 7.2,
backgroundColor: colors.WHITE,
alignSelf: 'center',
borderRadius: 5,
},
button: {
marginTop: 4
}
})
export default StoreReview