PHP code example of zediz / frieren

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

    

zediz / frieren example snippets


use Zediz\Frieren\Frieren;

// Subir un archivo desde $_FILES
$resultado = Frieren::saveFile($_FILES, '/usuarios/avatars');
// $resultado => ['path' => '...', 'filename' => '...', 'size' => ..., 'mime' => '...']

// Mover un archivo dentro del bucket
$movido = Frieren::moveFile('/usuarios/temp/foto.jpg', '/usuarios/definitivo');

// Eliminar un archivo
$eliminado = Frieren::deleteFile('mi-proyecto/usuarios/foto.jpg');

use Zediz\Frieren\Frieren;

// Enviar correo directo
$enviado = Frieren::sendEmail(
    recipients: ['Juan Pérez' => '[email protected]'],
    subject: 'Bienvenido',
    body: '<h1>Hola Juan</h1>'
);

// Usar un template HTML
$body = Frieren::parseEmailTemplate('bienvenida', [
    '||NOMBRE||' => 'Juan',
    '||LINK||'   => 'https://miapp.com/activar/abc123',
]);

Frieren::sendEmail(['Juan Pérez' => '[email protected]'], 'Bienvenido', $body);