I would like to add a second form to simple-todos that will send an e-mail with the to-do list. I’ve added to the .css and html, so I see them on my page. Just having trouble with calling the .js action.
Here is what I added.
simple-todos.html
in the body
{{> sendEmail}}
a new template:
#
E-mail Address:
Send E-mail
simple-todos.js
Template.sendEmail.events({
“submit .sendEmail”: function (event) {
var text = event.target.email.value
Meteor.call(‘sendEmail’,
text,
‘bob@example.com’,
‘Hello from Meteor!’,
‘This is a test of Email.send.’);
// Clear form
event.target.email.value = "";
// Prevent default form submit
return false;
}
});
simple-todos.css
.send-email {
margin-top: 10px;
margin-bottom: -10px;
position: relative;
margin-left: 1em;
}
.email-label input {
border: none;
}
.email-label input:focus{
outline: 0;
}
.email {
font-weight: bold;
background: none;
font-size: 1em;
position: relative;
}