code: function resolveVariables (template, record) {
      // if template is not string return empty string
      if (typeof template !== 'string') {
          return ''
      }
      // replace all variables with interpolated value
      return template.replace(/\$\{[^}]+\}/g, function (match) {
          return resolveVariable(match, record)
      })
  }
docs: @function resolveVariables
  
  resolve any variables in string with values from passed in object.
  
  variables must be in the ${variable.name} format and are retrieved from the
  passed in object using lodash _.get. If variable cannot be resolved from
  root of object an attempt will be made to resolve it from object.data.
  
  @param {string} template
  @param {object} record
  
  @returns {string}