Improvement in Contact plugin

Post Reply
dlb
Posts: 3
Joined: Wed Nov 12, 2025 9:11 am

Improvement in Contact plugin

Post by dlb »

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
Post Reply