finance-mgn - v2.1.0
    Preparing search index...
    • Creates an HTML email body with financial report data and saves it to a file.

      This function generates a comprehensive financial report email by:

      1. Calculating financial metrics using income/expense comparison
      2. Reading an HTML template file with placeholders
      3. Replacing template placeholders with dynamic financial data
      4. Saving the final HTML content to 'email-body.txt'

      Parameters

      • finalExpenses: Transaction[]

        Array of processed expense transactions

      • finalIncomes: Transaction[]

        Array of processed income transactions

      • finalInvestments: Transaction[]

        Array of processed investment transactions

      • sheetId: string

        Google Sheets document ID for generating the view link

      Returns void

      Will throw an error if the HTML template file cannot be read

      Will throw an error if the output file cannot be written

      The function expects an HTML template file to exist at src/static/email-template.html. The template should contain placeholders like {{EXPENSES_TOTAL}}, {{NET_INCOME}}, etc.