1. Go to this page and download the library: Download atomjoy/proton 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/ */
atomjoy / proton example snippets
use App\Models\User;
// Proton emails
use Proton\Mail\DefaultMail;
use Proton\Mail\RegisterMail;
use Proton\Mail\PasswordMail;
use Proton\Mail\F2aMail;
// Nano emails
use Proton\Mail\Nano\FullMail as NanoFullMail;
use Proton\Mail\Nano\BuyMail as NanoBuyMail;
Route::get('/proton', function () {
// User ('button' => 'Buy Now',
'url' => 'https://example.com/laptop',
'price' => '3299',
'currency' => 'USD',
];
$pr2 = [
'image' => 'https://raw.githubusercontent.com/atomjoy/proton/refs/heads/main/public/images/tablet.jpg',
'name' => 'Tablet Canyon Z9',
'text' => 'Get a ltablet 30% off',
'button' => 'Buy Now',
'url' => 'https://example.com/tablet',
'price' => '2299',
'currency' => 'USD',
];
$pr3 = [
'image' => 'https://raw.githubusercontent.com/atomjoy/proton/refs/heads/main/public/images/mobile.jpg',
'name' => 'Samsung X25',
'text' => 'Get a mobile 30% off',
'button' => 'Buy Now',
'url' => 'https://example.com/mobile',
'price' => '1299',
'currency' => 'USD',
];
$products = [$pr1, $pr2,];
$products_flex = [$pr1, $pr2, $pr3, $pr1, $pr2, $pr3];
$params = [
'user' => $user,
'text' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni doloremque fuga vel similique error, necessitatibus a sequi odit, adipisci minus ad possimus.',
'products' => $products,
'products_flex' => $products_flex,
];
$params_full = [
'user' => $user,
'text' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni doloremque fuga vel similique error, necessitatibus a sequi odit, adipisci minus ad possimus.',
'url' => 'https://url.example.com',
'password' => 'Xyz123Wo65',
'code' => '690470',
];
// Image margin bottom class
// nano-image-mb or proton-image-mb
// Nano email
Mail::to('[email protected]')->send(new NanoBuyMail(...$params));
Mail::to('[email protected]')->send(new NanoFullMail(...$params_full));
// Send email sample
Mail::to('[email protected]')->send(new DefaultMail());
// User reset password, use null for example
Mail::to('[email protected]')->send(new PasswordMail($user, '321-XXX-123'));
Mail::to('[email protected]')->locale('pl')->send(new PasswordMail($user, '321-XXX-123'));
// User activation link (User model