function mailCommon(type, data, req, res) {
  const { zlSite } = res.locals;

  if ('form-notice' === type) {
    if (data.text) {
      data.text += `\nReferred By: ${req.cookies.referer}\n\n`+
        `-----------------------------------------------------------`+
        `\nThis message was triggered by a website user's request.\n`+
        `From IP: ${req.ip}\nFrom Url: ${req.get('Referrer')}\n\n`+
        `This message was sent from a ${process.env.ZEAL_NETWORK_NAME} powered `+
        `Website. Login to your account to view more details.`
    }
  }

  // make from name use site name (but auth email address so it will relay)
  data.from = `"${zlSite.zsName}" ${process.env.ZEAL_NETWORK_EMAIL}`;

  if (zlSite.zsInternalConfig && zlSite.zsInternalConfig.displayEmail) {
    data.replyTo = `"${zlSite.zsName}" ${zlSite.zsInternalConfig.displayEmail}`;
  }
  return data;
}
function mailCommon(type, data, req, res) {
  const { zlSite } = res.locals;

  if ('form-notice' === type) {
    if (data.text) {
      data.text += `\nReferred By: ${req.cookies.referer}\n\n`+
        `-----------------------------------------------------------`+
        `\nThis message was triggered by a website user's request.\n`+
        `From IP: ${req.ip}\nFrom Url: ${req.get('Referrer')}\n\n`+
        `This message was sent from a ${process.env.ZEAL_NETWORK_NAME} powered `+
        `Website. Login to your account to view more details.`
    }
  }

  
  data.from = `"${zlSite.zsName}" ${process.env.ZEAL_NETWORK_EMAIL}`;

  if (zlSite.zsInternalConfig && zlSite.zsInternalConfig.displayEmail) {
    data.replyTo = `"${zlSite.zsName}" ${zlSite.zsInternalConfig.displayEmail}`;
  }
  return data;
}
function mailCommon ( type , data , req , res ) { const { zlSite } = res . locals ; if ( 'form-notice' === type ) { if ( data . text ) { data . text += ` \n ${ req . cookies . referer } \n \n ` + ` ` + ` \n \n ` + ` ${ req . ip } \n ${ req . get ( 'Referrer' ) } \n \n ` + ` ${ process . env . ZEAL_NETWORK_NAME } ` + ` ` } } // make from name use site name (but auth email address so it will relay) data . from = ` ${ zlSite . zsName } ${ process . env . ZEAL_NETWORK_EMAIL } ` ; if ( zlSite . zsInternalConfig && zlSite . zsInternalConfig . displayEmail ) { data . replyTo = ` ${ zlSite . zsName } ${ zlSite . zsInternalConfig . displayEmail } ` ; } return data ; }
add common details to email message
add common details to email message