forwardemail / email-templates

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
https://forwardemail.net/docs/send-emails-with-node-js-javascript
MIT License
3.67k stars 337 forks source link

Using with a different i18n library. #280

Closed immortalx closed 6 years ago

immortalx commented 6 years ago

Is it possible to use with i18next? Any example or directions on where to configure? I'm using email-templates just to render the e-mails with renderAll

Thank you

kibertoad commented 6 years ago

Why was this closed?

davidsonsns commented 6 years ago

I'm using i18n-node. I'll try to describe how I'm using it:

i18n.configure({ locales: ['en', 'pt-br'], directory: ${__dirname}/locales });

// according to your rule i18n.setLocale('pt-br');

email.render('./default/html', { i18n, name: 'Elon', people });

In your pug file just do as below
```js
p #{i18n.__('key i18n')}