# BootstrapEmail

#### new BootstrapEmail(templates, optionsopt)

Creates a new BootstrapEmail instance

##### Parameters:

`templates` ( string | Array.<string> )

Path to file, string containing HTML code or array of filepaths

`options` ( Object ) <optional>

###### Properties

`style` ( string ) <optional>

Path to .css or .scss file that should be inlined

`head` ( string ) <optional>

Path to .css or .scss file taht should be injected into header

`logLevel` ( LOG_LEVEL ) <optional>

Defaults to LOG_LEVEL.INFO

`variables` ( Object ) <optional>

Sets default SASS-Variables if not defined otherwise in SCSS-file

Source:
  - BootstrapEmail.js, line 74

### Members

#### (static) blockElements :Array.<string>

Array containing all tagnames of block-elements. Block-elements will be compiled differently

Source:
  - BootstrapEmail.js, line 432

#### (static, readonly) defaultVariables :Object

Default variables. Can be overwritten in the constructor

Source:
  - BootstrapEmail.js, line 426

#### (static) DOCTYPE :string

Doctype which will be used for parsed templates

Source:
  - BootstrapEmail.js, line 444

#### (static, constant) LOG_LEVEL :number

##### Properties:

Name | Type | Description
--- | --- | ---
`DEBUG` | number | 20
`INFO` | number | 30
`WARN` | number | 40
`ERROR` | number | 50
`FATAL` | number | 60

Source:
  - BootstrapEmail.js, line 33
See:
  - https://www.npmjs.com/package/bunyan#levels

#### (static, constant) STYLE_VARIABLES :string

##### Properties:

Name | Type | Description
--- | --- | ---
`COLUMNS` | string | $grid-columns
`CONTAINER_WIDTH` | string | $container-max-width

Source:
  - BootstrapEmail.js, line 20

#### (static) voidElements :Array.<string>

Array containing all tagnames of void-elements which cannot contain any

Source:
  - BootstrapEmail.js, line 438

#### (private) _headPath :string

Path to (s)css file which should be injected to

Source:
  - BootstrapEmail.js, line 93

#### (private) _logger :Logger

"Bunyan"-Instance for loggin

Source:
  - BootstrapEmail.js, line 107

#### (private) _stylePath :string

Path to main (s)css file

Source:
  - BootstrapEmail.js, line 86

#### (private) _templates :Array.<{$:cheerio, path:string}>

Contains parsed html-templates which will be compiled

Source:
  - BootstrapEmail.js, line 117

#### (private) _vars :Object

Merged object containing default styling variables

Source:
  - BootstrapEmail.js, line 100

### Methods

#### (private) ._compileHtml()

Replaces bootstrap classes with saved workarounds

Source:
  - BootstrapEmail.js, line 224

#### (private) ._injectHead()

Injects content of given head-file into the head of each template

Source:
  - BootstrapEmail.js, line 293

#### (private) ._inlineCss()

Inlines all css classes into style attributes

Source:
  - BootstrapEmail.js, line 279

#### (private) ._loadStyle(stylePath) → {Object|Object}

Loads file from given sourcepath. If file is scss or sass, it will be compiled into css

##### Parameters:

`stylePath` ()

Source:
  - BootstrapEmail.js, line 395

#### (private) ._output() → {string|Array.<{path:string, document:string}>}

Prepares user-friendly output structure

Source:
  - BootstrapEmail.js, line 331

#### (private) ._processStyle(stylePath) → {Object}

Loads style and extracts all media queries

##### Parameters:

`stylePath` ( string )

Source:
  - BootstrapEmail.js, line 353

#### .compile() → {string|Array.<{path: string, document: string}>}

Performs a full compile and returns compiled templates

Source:
  - BootstrapEmail.js, line 190

#### .compileAndSave(filePath)

Performs a full compile and saves documents to given destination

##### Parameters:

`filePath` ( string )

If only one template is compiled, filePath takes a full path including filename and extension. Otherwise it takes only the directory name and uses the filename from inputfiles

Source:
  - BootstrapEmail.js, line 203