React Base Fiddle (JSX)
Starting point for creating JSFiddles with React.
HTML
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://smtpjs.com/v3/smtp.js">
</script>
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
Babel + JSX
class Hello extends React.Component {
constructor(props){
super(props)
this.sendMail = this.sendMail.bind(this);
}
sendMail() {
window.Email.send({
SecureToken : "C973D7AD-F097-4B95-91F4-40ABC5567812",
To : 'them@website.com',
From : "you@isp.com",
Subject : "This is the subject",
Body : "And this is the body"
}).then(
message => alert(message)
);
}
render() {
return (
<button onClick={this.sendMail} > Send Mail </button>
)
}
}
ReactDOM.render(
<Hello name="World" />,
document.getElementById('container')
);