Closed
Description
Hi, it appears per recipient substitution data key is inconsistent consider the following:
$recipients = [ [ 'name' => 'Foo', 'email' => 'foo@example.com' ], [ 'name' => 'Bar', 'email' => 'bar@example.com' ], ]; $mail[ 'substitutionData' ] = [ 'Company' => 'My Company Name - Works' ]; $mail 'subject' ] = 'Welcome to a Spark Post API Test'; $mail[ 'text' ] = 'Hi {{Name or 'Customer'}}, sent from {{Company}}'; $mail[ 'recipients' ] = []; foreach ( $recipients as $recipient ) { $mail[ 'recipients' ][] = [ 'address' => [ 'name' => $recipient[ 'name' ], 'email' => $recipient[ 'email' ] ], 'substitutionData' => [ 'Name' => $recipient[ 'name' ] . ' - Nope' ], 'substitution_data' => [ 'Name' => $recipient[ 'name' ] . '- Works' ] ]; };
Metadata
Metadata
Assignees
Labels
No labels