import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; import Actions from "../actions.js"; import { Button } from 'react-bootstrap'; import { Messages } from "meteor/nova:core"; import NovaEmail from 'meteor/nova:email'; const Loading = Telescope.components.Loading; class Email extends Component { constructor() { super(); this.sendTest = this.sendTest.bind(this); this.state = { loading: false } } sendTest() { this.setState({loading: true}); 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 = NovaEmail.emails; return (

Emails

{_.map(emails, (email, key) => )}
Name Template Subject HTML Preview Send Test
) } module.exports = Emails export default Emails