Using meteor and blaze how to convert a template to a string for the email body?

And how can I set the value of this now? Those. in js? All I see is how to do it in the steering wheel.

+4
source share
2 answers

Meteor does not currently support server-side template support, and since you are sending emails from the server, this creates a problem. A server-side screwdriver is included in the Meteor roadmap, but so far we can use the package. it is called "Handlebars-server" and can be found here: https://atmospherejs.com/package/handlebars-server

Handlebars-server . readme , .

+1

Meteorpedia:

http://www.meteorpedia.com/read/Blaze_Notes

" HTML "

var toHTMLWithData = function (kind, data) {
    return UI.toHTML(kind.extend({data: function () { return data; }}));
};

:

var myTemplateAsString=toHTMLWithData(Template.myTemplate,dataContext);

:

var myTemplateAsString=Template.myTemplate(dataContext);
+2

Source: https://habr.com/ru/post/1537943/


All Articles