PHP code example of pigeon / pigeon-laravel

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

    

pigeon / pigeon-laravel example snippets


$message_identifier = 'message-identifier';
$parcels = ['to' => '[email protected]'];

Pigeon::deliver($message_identifier, $parcels);

$parcels = [
  'to' => 'John Doe <[email protected]>',
  'cc' => [
    '[email protected]',
    'Sales Team <[email protected]>'
  ],
  'data' => [
    // template variables are added here
    'name' => 'John'
  ],
  'attachments' => [
    // `file` can be either local file path or remote URL
    [
      'file' => '/path/to/image.png',
      'name' => 'Logo'
    ],
    [
      'file' => 'https://example.com/guide.pdf',
      'name' => 'Guide'
    ]
  ]
];

$parcels = [
  [
    'to' => 'John Doe <[email protected]>',
    'data' => [
      // template variables are added here
      'name' => 'John'
    ]
  ],
  [
    'to' => 'Jane Doe <[email protected]>',
    'data' => [
      // template variables are added here
      'name' => 'Jane'
    ]
  ],
];

'providers' => [
    // ...
    Pigeon\Laravel\PigeonServiceProvider::class,
];

php artisan vendor:publish  --provider="Pigeon\Laravel\PigeonServiceProvider" --tag="config"

php artisan vendor:publish