public function contactUsMail($data)
    {
        //Checks that all required data is present
        key_exists_or_fail(['email', 'first_name', 'last_name', 'message'], $data);

        $this->viewBuilder()->setTemplate('MeCms.Systems/contact_us');
        $this->setSender($data['email'], sprintf('%s %s', $data['first_name'], $data['last_name']))
            ->setReplyTo($data['email'], sprintf('%s %s', $data['first_name'], $data['last_name']))
            ->setTo(getConfigOrFail('email.webmaster'))
            ->setSubject(__d('me_cms', 'Email from {0}', getConfigOrFail('main.title')))
            ->setViewVars([
                'email' => $data['email'],
                'firstName' => $data['first_name'],
                'lastName' => $data['last_name'],
                'message' => $data['message'],
            ]);
    }
public function contactUsMail($data)
    {
        //Checks that all required data is present
        key_exists_or_fail(['email', 'first_name', 'last_name', 'message'], $data);

        $this->viewBuilder()->setTemplate('MeCms.Systems/contact_us');
        $this->setSender($data['email'], sprintf('%s %s', $data['first_name'], $data['last_name']))
            ->setReplyTo($data['email'], sprintf('%s %s', $data['first_name'], $data['last_name']))
            ->setTo(getConfigOrFail('email.webmaster'))
            ->setSubject(__d('me_cms', 'Email from {0}', getConfigOrFail('main.title')))
            ->setViewVars([
                'email' => $data['email'],
                'firstName' => $data['first_name'],
                'lastName' => $data['last_name'],
                'message' => $data['message'],
            ]);
    }
public function contactUsMail ( $ data ) { //Checks that all required data is present key_exists_or_fail ( [ 'email' , 'first_name' , 'last_name' , 'message' ] , $ data ) ; $ this -> viewBuilder ( ) -> setTemplate ( 'MeCms.Systems/contact_us' ) ; $ this -> setSender ( $ data [ 'email' ] , sprintf ( '%s %s' , $ data [ 'first_name' ] , $ data [ 'last_name' ] ) ) -> setReplyTo ( $ data [ 'email' ] , sprintf ( '%s %s' , $ data [ 'first_name' ] , $ data [ 'last_name' ] ) ) -> setTo ( getConfigOrFail ( 'email.webmaster' ) ) -> setSubject ( __d ( 'me_cms' , 'Email from {0}' , getConfigOrFail ( 'main.title' ) ) ) -> setViewVars ( [ 'email' => $ data [ 'email' ] , 'firstName' => $ data [ 'first_name' ] , 'lastName' => $ data [ 'last_name' ] , 'message' => $ data [ 'message' ] , ] ) ; }
Email for the "contact us" form.

The `$data` array must contain the `email`, `first_name`, `last_name`
and `message` keys.
@param array $data Form data
@return void
Email for the contact us form .