title = "Contact" url = "/contact" layout = "default" description = "Contact page" meta_title = "Get in touch with House of Chairs" is_hidden = 0 == themeUrl('assets/images/contact-us-banner.jpg'); } function onSubmit() { $rules = [ 'name' => 'required|min:2|max:64', 'phone' => 'required', 'email' => 'required|email|min:2|max:64', 'comments' => 'required|min:5', ]; $validation = Validator::make(post(), $rules); if ($validation->fails()) { throw new ValidationException($validation); } if (!$group = Backend\Models\UserGroup::whereCode('support-contact')->first()) { throw new ApplicationException('Please create an admin group with code: support-contact'); } $contacts = $group->users->lists('full_name', 'email'); Mail::sendTo($contacts, 'contact::form.message', post(), function($message) { $message->replyTo(post('email'), post('name')); }); $this['success'] = true; } ?> ==
{% content 'contact/page' %}
{% content 'contact/details' %}
{% partial 'contact/form' %}