Skip to content

Commit 7a30acb

Browse files
committed
fix: use a simple associative array for the template replacements
Refs: RW-90
1 parent 8e91f17 commit 7a30acb

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

html/modules/custom/reliefweb_subscriptions/src/Services/AwsSesClient.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -281,17 +281,10 @@ public function renderTemplate($template, array $replacements = []) {
281281
* Key value array of replacements.
282282
*
283283
* @return string
284-
* JSON encoded array of items with Name (key) and Value (value) properties.
284+
* JSON encoded key/value pairs.
285285
*/
286286
protected function convertReplacements(array $replacements = []) {
287-
$pairs = [];
288-
foreach ($replacements as $key => $value) {
289-
$pairs[] = [
290-
'Name' => $key,
291-
'Value' => $value,
292-
];
293-
}
294-
return json_encode($pairs);
287+
return json_encode($replacements, \JSON_FORCE_OBJECT);
295288
}
296289

297290
}

0 commit comments

Comments
 (0)