agenciafmd / admix-postal
Postal - Agência F&MD
Installs: 5 799
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- laravel/framework: 5.8.*
- msurguy/honeypot: dev-master
README
- Map all forms from your application and send them to specific emails
Installation
composer require agenciafmd/admix-postal:dev-master
Run the migrations
php artisan migrate
If you want to use the seeder, run
php artisan vendor:publish --tag=admix-postal:seeders
Usage
// if you want to send attachments $attachments = null; if ($request->has('images')) { $images = $request->file('images'); foreach ($images as $image) { $customName = Str::of($request->name)->slug() . '-' . Str::random(5) . '.' . $image->getClientOriginalExtension(); /* TODO: refactor with Storage */ $attachments[] = storage_path( 'app/' . $image ->storeAs('attachments', $customName, 'local') ); } } // fill if you want to customize the subject $customSubject = null; Postal::query() ->where('slug', 'slug-of-created-form') ->first() ->notify(new SendNotification([ 'greeting' => $request->subject, 'introLines' => [ '**Nome:** ' . $request->name, '**E-mail:** ' . $request->email, '**Telefone:** ' . $request->phone, '**Cidade:** ' . $request->city . ' - ' . $request->state, '**Mensagem:** ' . nl2br($request->message), ], ], [$request->email => $request->name], $attachments, $customSubject));