As the previous plugin used the Craft Contact Form as base, you would implement custom validation rules like this:
use craft\contactform\Models\Submission;
Event::on(
Submission::class,
Model::EVENT_DEFINE_RULES,
static function (DefineRulesEvent $event) {
$event->rules[] = [['fromName', 'fromEmail', 'subject', 'message'], 'required'];
}
);
As the plugin no longer uses the Craft Contact form, the namespace would now be: hybridinteractive\SimpleContactForm\Models\Submission;
As the previous plugin used the Craft Contact Form as base, you would implement custom validation rules like this:
As the plugin no longer uses the Craft Contact form, the namespace would now be:
hybridinteractive\SimpleContactForm\Models\Submission;