Refactor new customer email template and attachments handling

- Update welcome email template to conditionally include corporate ID.
- Remove unused base64 signature utility and clean up the email class.
- Comment out attachments array for potential future updates.
This commit is contained in:
Jeppe Bundgaard
2026-02-17 12:07:03 +01:00
parent b7648ccc2c
commit efaed8c6cc
2 changed files with 7 additions and 16 deletions
+6 -15
View File
@@ -470,10 +470,12 @@ use Psr\Http\Client\ClientExceptionInterface;
$html .= self::generateHtmlFooter();
// Prepare attachment (departments flyer)
$this->attachments = [
[
'https://www.truckwash.dk/wp-content/uploads/2024/10/Truck-Wash_Flyer_A5.pdf',
'Truck Wash Afdelinger.pdf'
]
/**
* [
* 'https://www.truckwash.dk/wp-content/uploads/2024/10/Truck-Wash_Flyer_A5.pdf',
* 'Truck Wash Afdelinger.pdf'
* ]
*/
];
// Send the email via MailerSend
$this->sendEmailMailerSend(
@@ -486,15 +488,4 @@ use Psr\Http\Client\ClientExceptionInterface;
$this->attachments
);
}
private static function getBase64Signature(string $signature_name): ?string
{
$signature_path = WD . '/modules/email/assets/' . $signature_name . '-signature.png';
if (file_exists($signature_path)) {
return base64_encode(file_get_contents($signature_path));
}
return null;
}
}
@@ -67,7 +67,7 @@ class email_template_new_customer
<!-- Intro -->
<p class="container-text-md">
Tak for din registrering af <?=((new users_o())->getCustomerName((int)$this->customer_number))?> (<?=((new users_o())->getCustomerEcocomicData()->economic_customer->corporateIdentificationNumber)?>) som kunde hos Truck Wash.
Tak for din registrering af <?=((new users_o())->getCustomerName((int)$this->customer_number))?><?=(((new users_o())->getCustomerEcocomicData((int)$this->customer_number)->economic_customer->corporateIdentificationNumber) ? ' (' . (new users_o())->getCustomerEcocomicData((int)$this->customer_number)->economic_customer->corporateIdentificationNumber . ')' : '')?> som kunde hos Truck Wash.
</p>
<!-- You can now wash your trucks -->