Don't add a CTA if an emails contains a P.S.

Don't automatically add a CTA to a daily email if the email body text
already contains a "P.S.".
This commit is contained in:
Oliver Davies 2025-06-21 00:34:47 +01:00
parent b7f13b4be5
commit 9abf64b504
2 changed files with 16 additions and 1 deletions

View file

@ -22,7 +22,9 @@ readonly final class AddRandomCtaToDailyEmail {
return;
}
// TODO: Don't add a CTA if the email already contains a "P.S.".
if (str_contains(haystack: $email->get('body')->value, needle: 'P.S.')) {
return;
}
$nodeStorage = $this->entityTypeManager->getStorage('node');
$query = $nodeStorage->getQuery();