The most effective way to send newsletters

Today, when I send basic emails, I use the Mail class, which is a custom wrapper using SwiftMailer, for example:

<?php
Mail::create('Message title')
        ->template('Template string or view path. Global variable "var" is "{var}". Current user is {username}.')
        ->tags(array('var' => 'value 1'))
        ->from('contact@mydomain.com')
        ->to('mail@example.com', array('username' => 'Boris'))
        ->transport(Mail::SMTP)
        ->send();

It works great for basic emails, but cannot be used to send newsletters for several reasons:

  • Pool Management
  • Delayed Shipment
  • Lack of tracking

So, I was thinking of a way to centralize more complex email management. I made a diagram:

enter image description here

I don’t want the remote server to save any contact information , only campaigns, recipients and statistics, for example, the following diagram:

Database diagram

< " ) , ​​, API , :

<?php
$result = NewsletterAPI::getRecipientsViewReport($campaignRef);
//
// Will contain something like : 
// Array
// (
//   [recipients] => Array
//     (
//       [0] => Array
//         (
//           [email] => toto@gmail.com
//           [opened] => 3
//           [last_open_date] => '2015-02-02 12:32:23', 
//           [data] => Array
//             (
//               [id] => 123
//             )
//         )
//       [1] => Array
//         (
//           [email] => tata@hotmail.com
//           [opened] => 0
//           [last_open_date] => null, 
//           [data] => Array
//            (
//              [id] => 17
//            )
//        )
//    )
// )

, . , .

, , admin API- API (, ).

, -, api , (, " mailing_api_key" " ).

,

, ?

( ), , .

, , :

  • ,
  • , , , ,
  • , , .

, , , , :

.. , .

, - , :

  • ( ),
  • , ,
  • :
    • (, ),
    • ,
    • ,
  • .. !

, , .

.

+4
1

() API, mailchimp. .

, , . , ... . (: ).

api, php.

+2

All Articles