Skip to content

Commit

Permalink
Fixed EmaiTrait not correctly working with email parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Skrypnyk committed Dec 16, 2020
1 parent 4c58f80 commit 8612677
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/D8/EmailTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function emailAssertEmailContains($field, PyStringNode $string, $exact =
$string = strval($string);
$string = $exact ? $string : trim(preg_replace('/\s+/', ' ', $string));
foreach (self::emailGetCollectedEmails() as $email) {
$field_string = $email['params'][$field] ?? $email[$field];
$field_string = $email[$field] ?? '';
$field_string = $exact ? $field_string : trim(preg_replace('/\s+/', ' ', $field_string));
if (strpos($field_string, $string) !== FALSE) {
return $email;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ function mysite_core_mail($key, &$message, $params) {
$message['subject'] = t('Test Email');
break;
}
$message['body'][] = strval($params['body']) ?? '';
}

0 comments on commit 8612677

Please sign in to comment.