I have been bumping into this weird edge-case, where Brevo API would ignore sent params sub-array and send empty for-loop emails back.
The bug in Brevo API is this:
If a contiguous array is provided, Brevo correctly processes it via for loop, e.g.:
array:2 [▼
"QUESTIONS" => array:6 [▼
0 => array:8 [▶]
1 => array:8 [▶]
2 => array:8 [▶]
3 => array:8 [▶]
4 => array:8 [▶]
5 => array:8 [▶]
]
"TOTAL" => 6
]
However, if non-contiguous array is provided (array with gaps), Brevo incorrectly ignores this array in for loop, e.g.:
array:2 [▼
"QUESTIONS" => array:6 [▼
0 => array:8 [▶]
1 => array:8 [▶]
2 => array:8 [▶]
3 => array:8 [▶]
5 => array:8 [▶]
]
"TOTAL" => 6
]
However, this is absolutely syntax-correct array in PHP.
Ayayay, Brevo!
I have been bumping into this weird edge-case, where Brevo API would ignore sent
paramssub-array and send emptyfor-loopemails back.The bug in Brevo API is this:
If a contiguous array is provided, Brevo correctly processes it via
for loop, e.g.:However, if non-contiguous array is provided (array with gaps), Brevo incorrectly ignores this array in
for loop, e.g.:However, this is absolutely syntax-correct array in PHP.
Ayayay, Brevo!