Merge pull request #24 from Herrie82/herrie/english

feat: Add English template & flexible generation
This commit is contained in:
Dimitar Nanov
2019-11-19 19:46:46 +02:00
committed by GitHub
3 changed files with 168 additions and 3 deletions

View File

@@ -16,10 +16,11 @@ const client = new ebics.Client({
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
const bankName = 'Bank name';
const template = fs.readFileSync('./templates/ini.hbs').toString();
const bankName = 'Bank name'; // Change this to the bank name you're going to send the letter to.
const languageCode = 'en'; // Currently 'de' and 'en' are valid values.
const template = fs.readFileSync('../templates/ini_'+languageCode+'.hbs').toString();
const letter = new ebics.BankLetter({ client, bankName, template });
const bankLetterFile = path.join(os.homedir(), 'bankLetter.html');
const bankLetterFile = path.join(os.homedir(), 'bankLetter_'+languageCode+'.html');
letter.serialize(bankLetterFile)
.then(() => {