src/Core/ContactEnquiryService.php
public function recordEnquiry(string $email, string $name, string $subject, string $message, callable $sendMailToAdminCallback) : ContactEnquiry
    {
        $enquiry = new ContactEnquiry(
            $this->clock, new EmailAddress($email), $name, $subject, $message
        );

        $this->repository->save($enquiry);

        $sendMailToAdminCallback($enquiry);

        return $enquiry;
    }
public function recordEnquiry(string $email, string $name, string $subject, string $message, callable $sendMailToAdminCallback) : ContactEnquiry
    {
        $enquiry = new ContactEnquiry(
            $this->clock, new EmailAddress($email), $name, $subject, $message
        );

        $this->repository->save($enquiry);

        $sendMailToAdminCallback($enquiry);

        return $enquiry;
    }
public function recordEnquiry ( string $ email , string $ name , string $ subject , string $ message , callable $ sendMailToAdminCallback ) : ContactEnquiry { $ enquiry = new ContactEnquiry ( $ this -> clock , new EmailAddress ( $ email ) , $ name , $ subject , $ message ) ; $ this -> repository -> save ( $ enquiry ) ; $ sendMailToAdminCallback ( $ enquiry ) ; return $ enquiry ; }
Records a contact enquiry.

@param string   $email
@param string   $name
@param string   $subject
@param string   $message
@param callable $sendMailToAdminCallback

@return ContactEnquiry
Records a contact enquiry .