PHP code example of marceloeatworld / plunk-laravel

1. Go to this page and download the library: Download marceloeatworld/plunk-laravel 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/ */

    

marceloeatworld / plunk-laravel example snippets


'mailers' => [
    // ... other mailers

    'plunk' => [
        'transport' => 'plunk',
    ],
],

Mail::to('[email protected]')->send(new WelcomeMail());

Mail::to('[email protected]')
    ->cc('[email protected]')
    ->bcc('[email protected]')
    ->send(new InvoiceMail());

use MarceloEatWorld\PlunkLaravel\Facades\Plunk;

// Send email directly
Plunk::sendEmail('[email protected]', 'Welcome', '<h1>Hello!</h1>', [
    'from' => '[email protected]',
    'name' => 'Your App',
    'reply' => '[email protected]',
]);

// Send with a Plunk template
Plunk::sendTemplate('[email protected]', 'tmpl_welcome', [
    'name' => 'John',
    'action_url' => 'https://app.example.com/verify',
]);

Plunk::trackEvent('[email protected]', 'signed_up', [
    'plan' => 'pro',
    'source' => 'landing_page',
]);

$result = Plunk::verifyEmail('[email protected]');

if ($result['data']['valid']) {
    // Email is valid
}

Plunk::sendEmail(
    [
        '[email protected]',
        ['name' => 'Bob Smith', 'email' => '[email protected]'],
    ],
    'Team Update',
    '<p>Hello team!</p>',
);

Plunk::sendEmail('[email protected]', 'Your Invoice', '<p>Attached.</p>', [
    'from' => '[email protected]',
    'attachments' => [
        [
            'filename' => 'invoice.pdf',
            'content' => base64_encode(file_get_contents('/path/to/invoice.pdf')),
            'contentType' => 'application/pdf',
        ],
    ],
]);
bash
php artisan vendor:publish --tag="plunk-config"