PHP code example of samueletur / magic-channel-notification

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

    

samueletur / magic-channel-notification example snippets

 php
public function via($notifiable)
{
    return ['magic'];
}
 php
    public function toArray($notifiable)
    {
        return [
            'template' => base64_encode($this->mailTemplate($notifiable)),
            'template_emails_to' => $notifiable->email,
            'mm2_assunto' => 'Novo arquivo compartilhado - Magic Files Exchange',
        ];
    }
 php
public function mailTemplate($notifiable)
{
    $template = get_class($this);

    return (new $template($this->groupFile))->toMail($notifiable)->render();
}