0.0.5 • Published 9 years ago

dpd-template v0.0.5

Weekly downloads
2
License
ISC
Repository
bitbucket
Last release
9 years ago

DPD-TEMPLATE

dpd-template is deployd resource to generate an HTML template with data, it uses EJS to have a dynamical templating system.


Templates folder

It's easy to use, you just have to put your templates in a folder templates at the root of your deployd project.

├── app.dpd
├── node_modules
├── public
├── resources
└── templates
    └── register.html
    └── forgot.html
    └── forgot.html

Examples

Next you have to add it in your event, here an example of validation mail with dpd-email on the event POST for my users collection :

dpd.template.post({"template": 'register.html', "data": {user: this}}, function(data) {
    dpd.email.post({
      to      : "xxxx@xxxxxxx.xx",
      subject : 'My subject',
      html    : data.html
    }, function ( err, results ) {
        console.log(results);
    });
});

So the main part is

dpd.template.post({"template": 'register.html', "data": {user: this}}, function(data) {
});

And it will return an object with the attributes html, this attribute contains your template generated.

EJS

If you want learn to user EJS you can go here http://www.embeddedjs.com/

About me

If you want to offer me a beer

Foo

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago