import path from 'path'; export default function emailTest(mailTo: string, username: string, aliasList: string[]) { const aliasTemplate = (x: string[]) => { let str = ''; for (const alias of x) { str = str + '
  • ' + alias + '
  • '; } return str; }; const template = { from: 'BorgWarehouse' + '<' + process.env.MAIL_SMTP_FROM + '>', to: mailTo, subject: 'Down status alert !', text: 'Some repositories require your attention ! Please, check your BorgWarehouse interface.', html: `
    BorgWarehouse
    alert icon

    Some repositories require your attention, ` + username + `!

    List of repositories with down status:

      ` + aliasTemplate(aliasList) + `
    🚩
    Please remember that the status is based on the last modification. Backups are encrypted from end to end between your client and the server controlled by BorgWarehouse. Don't forget to check the integrity of your backups regularly.
    `, attachments: [ { path: path.join(process.cwd(), 'helpers/templates/attachments/alert-icon.png'), cid: 'alert-icon', }, ], }; return template; }