1. Go to this page and download the library: Download jinexus/zend-notification 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/ */
jinexus / zend-notification example snippets
use JiNexus\Zend\Notification\Notification;
$notification = new Notification();
$notification->setFrom('[email protected]', 'Sender Name')
->setTo('[email protected]', 'Recipient Name')
->setSubject('Sample Subject')
->setContent(
'This is the body/content of the email, you can write here your thoughts.' .
'I\'ve got everything yet nothing to write, for my thoughts are in a constant fight.'
)
->send();
use JiNexus\Zend\Notification\Notification;
$notification = new Notification();
$notification->setFrom('[email protected]', 'Sender Name')
->setTo('[email protected]', 'Recipient One')
->addTo('[email protected]', 'Recipient Two')
->addTo('[email protected]', 'Recipient Three')
->setSubject('Your character defines you')
->setContent(
'There are two things that defines you. Your patience to learn when you don\'t know anything,
and your attitude to share when you know everything.'
)
->send();
use JiNexus\Zend\Notification\Notification;
$notification = new Notification();
$notification->setFrom('[email protected]', 'Sender Name')
->setTo(['[email protected]', '[email protected]'], 'Common Name')
->setSubject('What makes me superior?')
->setContent(
'The fact that I don\'t believe that I\'m better than anyone else
gives me an inevitable sense of superiority.'
)
->send();
use JiNexus\Zend\Notification\Notification;
$notification = new Notification();
$notification->setFrom('[email protected]', 'Sender Name')
->addTo(['[email protected]', '[email protected]'], 'Common Name')
->setSubject('I\'m from 90\'s')
->setContent(
'Let me tell you about a magical time. The rock stars were suicidal,
the rappers were criminals, and wrestling was real. It was the 90\'s'
)
->send();
/*
* This will set your email to a text content.
*/
$notification->setType('text');
/*
* This will set your email to an html content.
*/
$notification->setType('html');
/*
* You can also set multiple attachments.
*/
$notification->setAttachments([
'absolute-path-of-the-file.jpg',
'this-is-a-multiple-attachment.pdf',
]);
use JiNexus\Zend\Notification\Notification;
$notification = new Notification();
$notification->setFrom('[email protected]', 'Sender Name')
->setTo('[email protected]', 'Recipient Name')
->setSubject('Sample Subject')
->assemble()
->send();
$notification->setTemplateData([
'fullName' => 'Jimvirle Calago',
'message' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
'token' => '$2y$10$2pebvLw6RhmqiybYg6qNr.F.lCIEYf0HzPrKAxNTsrRZLRI5uhh1m'
]);