This question is related to a previous one.
In my case, I would like to simply add individual elements. I have the following input.json.
{
"content": [
],
"from": {
"email": "[email protected]",
"name": "Some Name"
},
"reply_to": {
"email": "[email protected]",
"name": "Some Name"
},
"personalizations": [{
"to": [{
"email": "[email protected]"
},
{
"email": "[email protected]"
}]
}]
}
I would like to append the subject and template_id so that the output.json looks like below.
{
"content": [
],
"from": {
"email": "[email protected]",
"name": "Some Name"
},
"reply_to": {
"email": "[email protected]",
"name": "Some Name"
},
"personalizations": [{
"to": [{
"email": "[email protected]"
},
{
"email": "[email protected]"
}],
"subject": "Some subject"
}],
"template_id": "someID"
}
How would I do that with jq (including the syntax for input.json and output.json) in bash?