Originally Posted by
delia
after creating numerous errors, the site is back to working. But no extra bbc email was sent/received. Since there was no errors was the class actually loaded? I assumed so but then realized I actually don't know. Definitely didn't work.
yeah, as i stated the loading can be tricky.
i have added a couple of trigger_error statements which should result in debug logs getting generated. we may be getting the observer loaded, but then may not make it inside the conditional if the following is overridden (or if the language is not english):
includes/languages/english/checkout_process.php:9: define('EMAIL_TEXT_SUBJECT', 'Order Confirmation');
the bcc will only work for an order confirmation to the customer.
so try adding the trigger_error statements and see if any debug logs get generated:
PHP Code:
<?php
class sendBCCofAdminEmails extends base
{
public function __construct()
{
$this->attach($this, [
'NOTIFY_EMAIL_BEFORE_PROCESS_ATTACHMENTS',
]);
}
public function update(&$class, $eventID, &$p1, &$p2, &$p3, &$p4, &$p5, &$p6, &$p7, &$p8)
{
switch ($eventID) {
case 'NOTIFY_EMAIL_BEFORE_PROCESS_ATTACHMENTS':
trigger_error('the observer got loaded!');
if ((strpos($p2->subject, 'Order Confirmation') !== false) && (strpos($p2->subject, 'NEW ORDER') === false)) {
trigger_error('we are inside the conditional!');
$p2->addBCC('trustpilot at whatever.com');
}
break;
}
}
}
best.
Bookmarks