Skip to content
Easily send e-mails to clients from data source using templates and data
Branch: master
Clone or download
Pull request Compare This branch is 38 commits behind plumthedev:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

personalized - Send personalized emails from templates.

downloads count issues count Build Status
GitHub repo size License PHP from Packagist

personalized is a PHP library with which you can easily send e-mails to clients from data source using templates. Templates uses variables to easily replace with real data. personalized can send mail directly from your mailbox using PHPMailer.

You can get data from:

  • CSV files
  • MySQL Database


  • PHP >= 7.0


$ composer require plumthedev/personalized


Below you can find some useful examples with description of library usage.

personalized have full documentation with Getting Started and Guide and API reference, here.


Templates is a HTML documents with variables which allows to personalize mail message for recipient.

<h1>Hello %{name}</h1>

personalized easily supports personalize mails.

    // require autoload and prepare $config
    $p = new Presonalized($config);
        global $personalized;        
        echo $personalized->template->personalize($client);

Variables are wrapped in %{} and their names come from the data source tables titles.


Data can be provided from CSV files and MySQL databases. You can easily manage provided data like filtering, getting by row or loop.

    // require autoload and prepare $config
    $p = new Presonalized($config);
    $scoreBigEnough = $p->data->filter(function($client){
        return $client['score'] > 10;

Data is a class which contains some useful methods to manage data.


You can sends mail using PHPMailer which is the best mail support PHP library. Can it be better?

    // require autoload and prepare $config
    $personalized = new Personalized($config);
        // $personalized is located globally so we need to declare use global $personalized
        global $personalized;
        // now personalize template and save result to variable
        $personalizedMailTemplate = $personalized->template->personalize($client);
        // set body of message and add recipient
        $personalized->mail->addAddress($client['email'], $client['name']);
        // send mail!


I want to thanks:

  • supergrecko - Thanks you for excellent feedback about system requirements and support with this!

Library in under development

Currently working on 1.0.0 release. If you want to contribute, I would be grateful!

You can’t perform that action at this time.