1. Go to this page and download the library: Download binomeway/nova-contact-tool library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
binomeway / nova-contact-tool example snippets
// NovaServiceProvider.php
public function tools()
{
return [
\OptimistDigital\NovaSettings\NovaSettings\NovaSettings::make(),
\BinomeWay\NovaContactTool\NovaContactTool\NovaContactTool::make(),
];
}
use BinomeWay\NovaContactTool\Facades\Contact;
$subscriber = Contact::subscribe($email, $name, $phone);
use BinomeWay\NovaContactTool\Facades\Contact;
Contact::unsubscribe($subscriber);
use BinomeWay\NovaContactTool\Facades\Contact;
Contact::send($message, $subscriber);
use BinomeWay\NovaContactTool\Facades\Contact;
use BinomeWay\NovaContactTool\Models\Subscriber;
// Perform validations
// Create a subscriber
$subscriber = new Subscriber();
// or use the subscribe method
$subscriber = Contact::subscribe($email, $name, $phone);
$message = 'Hello!';
$to = '[email protected]'; // Optional
$contact = Contact::send($message, $subscriber, $to);
// Checking if the mail was sent.
if($contact->hasSucceded()){
flash()->message('success', 'Yay! Email was sent.');
}
if($contact->hasFailed()){
flash()->message('error', $contact->errorMessage());
}