1. Go to this page and download the library: Download anikninja/mail-mapper 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/ */
use AnikNinja\MailMapper\Traits\NotifiesByEmailMapping;
class LeadController extends Controller
{
use NotifiesByEmailMapping;
public function store(Request $request)
{
// Business logic...
$this->notifyByMapping(
module: 'Sales',
menu: 'Lead Generation',
task: 'Create',
modelOrContext: $lead, // Lead Model Object or associative array providing context for placeholders.
extra: [
'custom_note' => 'Urgent lead created'
],
useRaw: false
);
}
}