1. Go to this page and download the library: Download bnomei/kirby-resend 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/ */
bnomei / kirby-resend example snippets
// regular "transactional" email
$to = '[email protected]';
$success = kirby()->email([
'from' => new \Kirby\Cms\User([
'email' => '[email protected]', // your verified resend sender
'name' => 'Example Name', // your name
]),
'to' => $to,
'subject' => 'Sending E-Mails is fun',
'body' => [
'html' => '<h1>Headline</h1><p>Text</p>',
'text' => "Headline\n\nText",
],
'transport' => resend()->transport(), // plugin helper to get SMTP config array
])->isSent();
$client = resend()->client();
$sendResult = $client->emails->send([
'from' => '[email protected]',
'to' => '[email protected]',
'subject' => 'Hello World',
'html' => '<strong>it works!</strong>',
]);
// Getting the ID from the response Email object
// https://github.com/resendlabs/resend-php/blob/main/src/Email.php
echo $sendResult->id;