Does this module support use in a react-native app? I'm looking for a simple way to background mail using an API. Thanks!

@flizzer,
I have not tested our module in react-native, but based on @penjual's error, perhaps this thread can help: https://github.com/facebook/react-native/issues/4968
Please let me know how it goes. Thanks!
Did you figure out how to get SendGrid working with React Native? I'm getting the same error message.
@rdagger No, I didn't. Ended up using a .NET web api 2 web service to interact with SendGrid. Repo here if you're interested in having a look. Good luck!
@rdagger, @flizzer,
We are just about to bring v9 out of beta, hopefully that will help you: https://github.com/sendgrid/sendgrid-csharp/tree/v9beta
@thinkingserious Thanks, are you also releasing a new Node.js version for React Native?
Hello @rdagger,
We are not releasing a version specifically targeting React Native, but we are working on similar improvements that we made to our C# SDK.
Do you have an ETA for the new Node.js release? Is it possible to try out the beta now?
Hello @rdagger,
I don't have an ETA yet. We have not left the planning stages just yet. If you would like to participate, please see the "Mail Helper Enhancement (v3 mail/send)" project here: https://github.com/sendgrid/sendgrid-nodejs/projects
With Best Regards,
Elmer
Thanks. I've found that using fetch works well for sending simple emails using the web api from React Native:
fetch('https://api.sendgrid.com/v3/mail/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + apikey,
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
}).then((response) => {
this.setState({response: `${response.status} - ${response.ok}`});
});
@rdagger What all did you contain in your body? And did you have to import any other modules?
@jaymjax1 I used @rdagger 's solution and I used the following format for for 'body':
let body = {
"personalizations": [
{
"to": [
{
"email": "[email protected]"
}
],
"subject": "Hello, World!"
}
],
"from": {
"email": "[email protected]"
},
"content": [
{
"type": "text/plain",
"value": "Hello, World!"
}
]
}
taken from https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html
I did not have to import any other modules. Hope this helps!
Most helpful comment
Thanks. I've found that using fetch works well for sending simple emails using the web api from React Native: