You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting an SSR is not defined uncaught reference error.
I've set up a template helper called sendUnits:
Template.EmailProperty.helpers({
sendUnits: function() {
var mailPropertyId = t.data._id;
return Units.findOne(mailPropertyId);
}
});
Uncaught ReferenceError: SSR is not definedEmailProperty.js?3d2014a058974929d3586076a654fdcac8d49b7d:22 Template.EmailProperty.events.click #submit-emailtemplate.js:278 (anonymous function)view.js:760 (anonymous function)view.js:414 Blaze._withCurrentViewview.js:759 (anonymous function)events.js:47 (anonymous function)jquery.js:4624 jQuery.event.dispatchjquery.js:4292 jQuery.event.add.elemData.handle
I have a server side template named : private/sendUnits.html
{{sendUnits}}
I have a click event handler:
/EmailProperty.js
'click #submit-email': function (e, t) {
e.preventDefault();
e.stopPropagation();
var mailTo = t.find(".mail-property").value;
var mailTo = '<' + mailTo + '>'
var mailPropertyId = t.data._id;
$('#mail-form').slideUp(200);
$('#mail-form').hide();
$('#mail-button').slideDown(300);
// attempted SSR.compileTemplate <-- same error as SSR.render
var htmlText = SSR.compileTemplate('sendUnits', Assets.getText('sendUnits.html'));
var htmlText = SSR.render('sendUnits', {propertyId: mailPropertyId});
Meteor.call('sendUnitsEmail',mailTo,'<[email protected]>','Subject test',htmlText);
}
I have a server Meteor call:
/server.js
Meteor.methods({
sendUnitsEmail: function (to, from, subject, htmlText) {
var propertyId = Units.findOne(this.propertyId);
console.log('sending unitsEmail');
var htmlText = SSR.render("sendUnits", {propertyId: propertyId});
console.log(htmlText);
Meteor.Mandrill.send({
to: to,
from: from,
subject: subject,
text: htmlText
});
}
});
I am unclear how to pass an ID from the client to the server, and then have it render a template with the helper 'sendUnits' and then have it respond with an email in rich HTML.
The text was updated successfully, but these errors were encountered:
@hvtor it looks like EmailProperty.js is client-side code. SSR only shows up on the server, you should not include SSR.compileTemplate('sendUnits', Assets.getText('sendUnits.html')); in this file.
I'm getting an SSR is not defined uncaught reference error.
I've set up a template helper called sendUnits:
Template.EmailProperty.helpers({
sendUnits: function() {
var mailPropertyId = t.data._id;
return Units.findOne(mailPropertyId);
}
});
Uncaught ReferenceError: SSR is not definedEmailProperty.js?3d2014a058974929d3586076a654fdcac8d49b7d:22 Template.EmailProperty.events.click #submit-emailtemplate.js:278 (anonymous function)view.js:760 (anonymous function)view.js:414 Blaze._withCurrentViewview.js:759 (anonymous function)events.js:47 (anonymous function)jquery.js:4624 jQuery.event.dispatchjquery.js:4292 jQuery.event.add.elemData.handle
I have a server side template named : private/sendUnits.html
{{sendUnits}}
I have a click event handler:
/EmailProperty.js
'click #submit-email': function (e, t) {
e.preventDefault();
e.stopPropagation();
var mailTo = t.find(".mail-property").value;
var mailTo = '<' + mailTo + '>'
var mailPropertyId = t.data._id;
I have a server Meteor call:
/server.js
I am unclear how to pass an ID from the client to the server, and then have it render a template with the helper 'sendUnits' and then have it respond with an email in rich HTML.
The text was updated successfully, but these errors were encountered: