From 589950b9ce2cb14f7d4f455b3095b75ec4cb377b Mon Sep 17 00:00:00 2001 From: Adithya Date: Tue, 11 May 2021 21:38:45 +0200 Subject: [PATCH] Bug fix to support empty values --- src/Services/Content/MergeContentService.php | 2 +- src/Services/Content/MergeSubjectService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/Content/MergeContentService.php b/src/Services/Content/MergeContentService.php index 1f34e3e6..7474660e 100644 --- a/src/Services/Content/MergeContentService.php +++ b/src/Services/Content/MergeContentService.php @@ -133,7 +133,7 @@ protected function mergeSubscriberTags(string $content, Message $message): strin ]; foreach ($tags as $key => $replace) { - $content = str_ireplace('{{' . $key . '}}', $replace, $content); + $content = str_ireplace('{{' . $key . '}}', $replace ?: '', $content); } return $content; diff --git a/src/Services/Content/MergeSubjectService.php b/src/Services/Content/MergeSubjectService.php index b1b77abb..7212fbc9 100644 --- a/src/Services/Content/MergeSubjectService.php +++ b/src/Services/Content/MergeSubjectService.php @@ -44,7 +44,7 @@ protected function mergeSubscriberTags(string $messageSubject, Message $message) ]; foreach ($tags as $key => $replace) { - $messageSubject = str_ireplace('{{' . $key . '}}', $replace, $messageSubject); + $messageSubject = str_ireplace('{{' . $key . '}}', $replace ?: '', $messageSubject); } return $messageSubject;