Supply a YAML file as configuration, as in this example. Via the document ID and SQL query, point at data in a Grist document.
Optionally, it inserts or update records in the database based on the data processed.
pip install grist-mailmerge
or
pipx install grist-mailmerge
grist-mailmerge --dry-run config.yml
grist-mailmerge config.yml
See the this example and the command line help.