import { Components, registerComponent } from 'meteor/vulcan:core'; import React, { PropTypes, Component } from 'react'; import { Button } from 'react-bootstrap'; import VulcanEmail from 'meteor/vulcan:email'; class Email extends Component { constructor() { super(); this.sendTest = this.sendTest.bind(this); this.state = { loading: false } } sendTest() { this.setState({loading: true}); // TODO fix this // Actions.call("email.test", this.props.name, (error, result) => { // this.setState({loading: false}); // if (error) { // Messages.flash(error.message, "error"); // } else { // Messages.flash(`Test email sent (“${result}”).`, "success"); // } // }); } render() { const {email, name} = this.props; return ( {name} {email.template} {email.subject({})} {email.path}
{this.state.loading ? : null}
) } } Email.propTypes = { email: React.PropTypes.object, name: React.PropTypes.string } const Emails = props => { const emails = VulcanEmail.emails; return (

Emails

{_.map(emails, (email, key) => )}
Name Template Subject HTML Preview Send Test
) } registerComponent('Emails', Emails);