Bank Letter: Add English template & flexible generation

Allow for both German (de) and English (en) initialization letters.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
This commit is contained in:
Herrie
2019-11-19 16:57:13 +01:00
parent 6ecb256483
commit 95403cbe6f
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(() => {