add ext-form

This commit is contained in:
2026-11-22 16:09:43 +01:00
parent ef4be66673
commit 932c7d21fe
25 changed files with 2681 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
namespace Plugi\Extensions\Form\Finishers;
use Plugi\Extensions;
class SendEmailToAdmin extends DefaultFinisher
{
public function execute(): bool
{
$to = Extensions::getSettings('form')['email']['value'];
$subject = 'Formulareinsendung: '.$this->getFormName();
$message = $this->getNiceFields();
return mail(
$to,
$subject,
$message,
$additional_headers = [],
$additional_params = ""
);
}
private function getNiceFields(): string {
$text = '';
foreach ($this->getFormFields() as $field) {
$text .= $field['label'] . ': ' . $this->getEntryFields()[$field['name']] . "\n";
}
return $text;
}
}