1. Go to this page and download the library: Download beebmx/kirby-courier 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/ */
beebmx / kirby-courier example snippets
use Beebmx\KirbyCourier\Notification\Message;
(new Message)
->to('[email protected]')
->line('Welcome to Kirby Courier')
->action('Visit', 'https://beeb.mx')
->send()
use Beebmx\KirbyCourier\Notification\Message;
(new Message)
->to('[email protected]')
->greeting('Hello friend!')
->line('Welcome to Kirby Courier')
->line('You can add more lines before an action')
->lines(['Multiple line 01', 'Multiple line 02'])
->lineIf($someCondition === true, 'You can add more lines before an action')
->linesIf($someCondition === false, ['Line 03', 'Line 04'])
->success() // To set the action button as successful
->error() // To set the action button as an error
->action('Action button', 'https://beeb.mx')
->line('You can add lines after an action')
->salutation('Good bye!')
->send()
use Beebmx\KirbyCourier\Mail\Message;
(new Message)
->to('[email protected]')
->template('marketing')
->send()
use Beebmx\KirbyCourier\Mail\Message;
(new Message)
->preset('contact') // The preset should be available in your config.php file
->from('[email protected]')
->from('[email protected]', 'Webmaster') // You can add a name to from address
->to('[email protected]')
->to('[email protected]') // You can add multiple recipients (TO)
->cc('[email protected]')
->cc('[email protected]') // You can add multiple recipients (CC)
->bcc('[email protected]')
->bcc('[email protected]') // You can add multiple recipients (BCC)
->replyTo('[email protected]')
->subject('Thank you for your contact request')
->theme('dark') // The theme should be available in your themes
->data(['name' => 'John Doe', 'position' => 'CEO']) // All the data available for the template
->attach($page->file('image.jpg'))
->attach($page->file('file.pdf')) // You can add multiple files
->attachMany([$page->file('file.pdf'), $page->file('file.jpg')])
->render() // Returns a Content instance to visualize
->send() // Trigger to send the email
<?= (new Beebmx\KirbyCourier\Mail\Message)
->template('marketing')
->data(['name' => 'John Doe'])
->render()
->toHtml()