fehler versandt
This commit is contained in:
@@ -3420,6 +3420,21 @@ class ApiKernel
|
||||
$stmt->execute(array_merge([$customerId], $templateIds));
|
||||
}
|
||||
|
||||
private function incrementTemplateUsage(int $customerId, int $templateId): void
|
||||
{
|
||||
if ($customerId <= 0 || $templateId <= 0) return;
|
||||
$usageTable = $this->lookupTableName('template_usage', 'emailtemplate_template_usage');
|
||||
if (!$this->tableExists($usageTable)) return;
|
||||
try {
|
||||
$sql = "INSERT INTO `$usageTable` (`template_id`,`customer_id`,`render_count`,`last_rendered_at`) VALUES (:tid,:cid,1,NOW())
|
||||
ON DUPLICATE KEY UPDATE `render_count` = `render_count` + 1, `last_rendered_at` = NOW(), `customer_id` = VALUES(`customer_id`)";
|
||||
$stmt = $this->pdo->prepare($sql);
|
||||
$stmt->execute([':tid' => $templateId, ':cid' => $customerId]);
|
||||
} catch (Throwable $e) {
|
||||
// Usage-Tracking darf keine Fehler auslösen.
|
||||
}
|
||||
}
|
||||
|
||||
private function extractIdList($raw): array
|
||||
{
|
||||
if ($raw === null) return [];
|
||||
|
||||
Reference in New Issue
Block a user