🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

grunt-email-templates

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-email-templates

Email templates task

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

grunt-email-templates Build Status

Email templates task

Getting Started

This plugin requires Grunt ~0.4.5. This task is encapsulation of node-email-templates.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-email-templates --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-email-templates');

The "email_templates" task

Overview

In your project's Gruntfile, add a section named email_templates to the data object passed into grunt.initConfig().

grunt.initConfig({
  email_templates: {
    your_target: {
      // Target-specific file lists and/or options go here.
      'target/folder': 'source/folder'
    },
  },
});

Options

htmlFileName

Type: String Default: html.html

Name of output file with html content.

txtFileName

Type: String Default: text.txt

Name of output file with text content.

locals

Type: Object Default: {}

Object with the variables used inside the templates.

Usage Examples

Default Options

In this example, the default options are used. Template from source/folder will be handled by emails-template and saved in target/folder with file names html.html and text.txt.

grunt.initConfig({
  email_templates: {
    files: {
      'target/folder': 'source/folder'
    },
  },
});

Custom filenames

Template from source/folder will be handled by emails-template and saved in target/folder with file names index.html and text.txt. Data inside the locals object will also interpolate within the template (eg. <%= name %> into Bobby).

grunt.initConfig({
  email_templates: {
    options: {
      htmlFileName: 'index.html',
      locals: {
        name: 'Bobby'
      }
    },
    files: {
      'target/folder': 'source/folder'
    },
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Changelog

0.2.0

  • added local options (thanks @dannytranlx)

0.1.1

  • added options for name of files

0.1.0

  • initial release

Keywords

grunt node-email-templates

FAQs

Package last updated on 02 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts