Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create message payload from template files #224

Open
acogoluegnes opened this issue Nov 7, 2019 · 4 comments
Open

Create message payload from template files #224

acogoluegnes opened this issue Nov 7, 2019 · 4 comments

Comments

@acogoluegnes
Copy link
Collaborator

From the mailing list.

Payload for published messages could be based on one or several template files that would contain placeholders to make the content dynamic, e.g.:

{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",
    "payload": {
        "trxid": "DEPOSIT-PUBSUB-${uuid}",
        "trx_amount": ${list('5000','10000','50000')},
        "trx_notes": "${list('Deposit','Expense')}"
    }
}

Other candidate "functions" in placeholder could be sequence, random (not an UUID, just a random, 10-character long string).

Functions could accept arguments, e.g. ${random(length:16, cache:50)}.

@typekpb
Copy link

typekpb commented Apr 17, 2020

any timeline on this one?
For me would be the sequence function important

@michaelklishin
Copy link
Member

@typekpb this is open source software so you are welcome to contribute it.

@michaelklishin
Copy link
Member

@acogoluegnes is there a library that handles such template functions or we'd have to effectively develop a tiny templating language ourselves? In the latter case this probably shouldn't be labeled with effort-low :)

@acogoluegnes
Copy link
Collaborator Author

@michaelklishin Fair enough, this will require a custom development, adding effort-medium :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants