Improvement in Contact plugin
Posted: Thu Nov 13, 2025 4:38 pm
instead of modfying "Website Title" in the contact-form.php each time you install wondercms you can do this:
Nearly at the end you'll find this fonction:
if (empty($aFout)) {
$formulier = FALSE;
// Use the admin email as the From address
$fromEmail = $cfg['email']; // Admin email from the plugin configuration
$fromName = $Wcms->get('config', 'siteTitle'); // REPLACE JUST THIS LINE
// Improved email headers
$headers = "From: " . $fromName . " <" . $fromEmail . ">\r\n";
$headers .= "Reply-To: \"" . $name . "\" <" . $email . ">\r\n";
$headers .= "Return-Path: <" . $fromEmail . ">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
Before:
$fromName = "Website Title";
Now:
$fromName = $Wcms->get('config', 'siteTitle'); // this will automatically get you site name.
Have a nice evening
Avril
Nearly at the end you'll find this fonction:
if (empty($aFout)) {
$formulier = FALSE;
// Use the admin email as the From address
$fromEmail = $cfg['email']; // Admin email from the plugin configuration
$fromName = $Wcms->get('config', 'siteTitle'); // REPLACE JUST THIS LINE
// Improved email headers
$headers = "From: " . $fromName . " <" . $fromEmail . ">\r\n";
$headers .= "Reply-To: \"" . $name . "\" <" . $email . ">\r\n";
$headers .= "Return-Path: <" . $fromEmail . ">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
Before:
$fromName = "Website Title";
Now:
$fromName = $Wcms->get('config', 'siteTitle'); // this will automatically get you site name.
Have a nice evening
Avril