New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

evernote-email

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evernote-email - npm Package Compare versions

Comparing version 0.1.0 to 0.1.2

65

gruntfile.js
module.exports = function(grunt) {
var fs = require('fs');
// to change the template you want to compile into HTML update the global config variables
var globalConfig = {
language: 'en',
data: 'welcome',
template: 'welcome',
directory: 'messages'
content: 'welcome-content', // JSON file name without -lang
template: 'welcome-template', // template file name
contentDirectory: 'welcome', // content directory for JSON file
templateDirectory: 'messages', // template directory
buildDirectory: 'welcome-email' // final build directory name
};

@@ -15,4 +18,4 @@

if(grunt.option('data') != undefined){
globalConfig.data = grunt.option('data');
if(grunt.option('content') != undefined){
globalConfig.content = grunt.option('content');
}

@@ -24,6 +27,30 @@

if(grunt.option('directory') != undefined){
globalConfig.directory = grunt.option('directory');
if(grunt.option('contentDirectory') != undefined){
globalConfig.contentDirectory = grunt.option('contentDirectory');
}
if(grunt.option('templateDirectory') != undefined){
globalConfig.templateDirectory = grunt.option('templateDirectory');
}
if(grunt.option('buildDirectory') != undefined){
globalConfig.buildDirectory = grunt.option('buildDirectory');
}
grunt.registerTask('email-builder', function(){
var filename = 'emails/content/'+ globalConfig.directory + '/'+ globalConfig.data +'-'+ globalConfig.language +'.json',
fileContent = fs.readFileSync(filename),
content = JSON.parse(fileContent);
if(globalConfig.language !== 'en'){
content.email[0].intl = 'yes';
}
//Serialize as JSON and Write it to a file
fs.writeFileSync(filename, JSON.stringify(content, null, 4));
//call compile handlebars
grunt.task.run('compile-handlebars');
});
grunt.initConfig({

@@ -64,14 +91,14 @@ globalConfig: globalConfig,

'compile-handlebars': {
allStatic: {
templateData: 'content/<%= globalConfig.directory %>/<%= globalConfig.data %>-<%= globalConfig.language %>.json',
template: 'templates/<%= globalConfig.directory %>/<%= globalConfig.template %>.handlebars',
output: 'build/<%= globalConfig.directory %>/<%= globalConfig.data %>-<%= globalConfig.language %>.html',
partials: [
'partials/*.handlebars',
'partials/language/<%= globalConfig.language %>/language.handlebars'
],
globals: [
],
},
allStatic: {
templateData: 'emails/content/<%= globalConfig.contentDirectory %>/<%= globalConfig.content %>-<%= globalConfig.language %>.json',
template: 'emails/templates/<%= globalConfig.templateDirectory %>/<%= globalConfig.template %>.handlebars',
output: 'build/<%= globalConfig.buildDirectory %>/<%= globalConfig.content %>-<%= globalConfig.language %>.html',
partials: [
'emails/partials/*.handlebars',
'emails/partials/language/<%= globalConfig.language %>/language.handlebars'
],
globals: [
],
},
},
jsonlint: {

@@ -78,0 +105,0 @@ sample: {

{
"name": "evernote-email",
"version": "0.1.0",
"version": "0.1.2",
"description": "Grunt for Evernote Email",

@@ -5,0 +5,0 @@ "repository": "https://github.com/evernote/email-builder",

@@ -8,2 +8,8 @@ # Evernote Email Builder

## Getting Started
### Install
```bash
npm install evernote-email
```
_If you haven't used [grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide._

@@ -28,8 +34,10 @@

```bash
```js
var globalConfig = {
language: 'en',
data: 'welcome',
template: 'welcome',
directory: 'messages'
content: 'welcome-content', // JSON file name without -lang
template: 'welcome-template', // template file name
contentDirectory: 'welcome', // content directory for JSON file
templateDirectory: 'messages', // template directory
buildDirectory: 'welcome-email' // final build directory name
};

@@ -41,3 +49,3 @@ ```

```bash
grunt compile-handlebars --directory=messages --data=welcome --template=welcome --lang=en
grunt email-builder --content=welcome-content --template=welcome-template --contentDirectory=welcome --templateDirectory=messages --buildDirectory=welcome-email --lang=en
```

@@ -44,0 +52,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc