title: Most efficient way to send newsletters
body: <p>Today when I'm sending basic emails, I use a "Mail" class which is a custom wrapper using SwiftMailer, like so :</p>
  
  <pre><code>&lt;?php
  Mail::create('Message title')
          -&gt;template('Template string or view path. Global variable "var" is "{var}". Current user is {username}.')
          -&gt;tags(array('var' =&gt; 'value 1'))
          -&gt;from('contact@mydomain.com')
          -&gt;to('mail@example.com', array('username' =&gt; 'Boris'))
          -&gt;transport(Mail::SMTP)
          -&gt;send();
  </code></pre>
  
  <p>It works fine for basic emails but can't be used to send newsletters for multiple reasons : </p>
  
  <ul>
  <li>No pool management</li>
  <li>No deferred sending</li>
  <li>No tracking</li>
  </ul>
  
  <p>So I thought about a way to centralize more complex email management. I made a schema : </p>
  
  <p><img src="https://i.stack.imgur.com/gjGes.jpg" alt="enter image description here"></p>
  
  <p><strong>I don't want the distant server to store any contact information</strong>, only campaigns, recipients and statistics, like the following diagram: </p>
  
  <p><img src="https://i.stack.imgur.com/ofbIj.jpg" alt="Database diagram"></p>
  
  <p>The "<strong>data</strong>" field of the "<strong>Recipient</strong>" table is here to store custom data structure that will be sent back when the API is asked for information about a recipient. For example : </p>
  
  <pre><code>&lt;?php
  $result = NewsletterAPI::getRecipientsViewReport($campaignRef);
  //
  // Will contain something like : 
  // Array
  // (
  //   [recipients] =&gt; Array
  //     (
  //       [0] =&gt; Array
  //         (
  //           [email] =&gt; toto@gmail.com
  //           [opened] =&gt; 3
  //           [last_open_date] =&gt; '2015-02-02 12:32:23', 
  //           [data] =&gt; Array
  //             (
  //               [id] =&gt; 123
  //             )
  //         )
  //       [1] =&gt; Array
  //         (
  //           [email] =&gt; tata@hotmail.com
  //           [opened] =&gt; 0
  //           [last_open_date] =&gt; null, 
  //           [data] =&gt; Array
  //            (
  //              [id] =&gt; 17
  //            )
  //        )
  //    )
  // )
  </code></pre>
  
  <p>The distant server doesn't care about anything else than sending emails and getting statistics on them. No matter what entities are behind email addresses or how users are managed.</p>
  
  <p>It only prevent a user to access data it doesn't own, and prevent non admin users to access admin API methods (like create users).</p>
  
  <p>This way it's very easy to integrate in any website, I just have to store the api key of the account I want to send mail with (like adding a "<strong>mailing_api_key</strong>" field in my "<strong>User</strong>" entity for example).</p>
  
  <h2>So my question</h2>
  
  <p>First of all, what do you think about this architecture ? </p>
  
  <p>In real world usage, the amount of emails should not be very huge (few thousands a week), but I would like the system to be a minimum robust.</p>
  
  <p>Aside of that, there are three main problems that I can think of : </p>
  
  <ul>
  <li>Being blacklisted, </li>
  <li>Have bad statistics results because I don't know any other way to track views than using a tracking image and it's very easy to block, </li>
  <li>Detect bounces seems pretty complex from what I've read and I've no experience with it.</li>
  </ul>
  
  <p>So I've done some researches to find specialized services which can handle this, like : </p>
  
  <ul>
  <li><a href="http://mailchimp.com/" rel="nofollow noreferrer">Mailchimp</a></li>
  <li><a href="http://sendinblue.com/" rel="nofollow noreferrer">Sendinblue</a></li>
  <li><a href="http://www.mpzmail.com/" rel="nofollow noreferrer">MPZMail</a></li>
  <li><a href="http://campayn.com/" rel="nofollow noreferrer">Campayn</a></li>
  <li><a href="http://freshmail.com/" rel="nofollow noreferrer">FreshMail</a></li>
  </ul>
  
  <p>and so on.. But all of them wants to manage contacts and a lot of things I don't care of. </p>
  
  <p>I just want a service <strong>with no UI at all</strong>, that do something close to what I've described above: </p>
  
  <ul>
  <li>Dynamic account creation (only for admin account), </li>
  <li>Send emails to a custom list of addresses each time, <strong>with no limit and no pre-created mailing list of any sort</strong>, </li>
  <li>Easy way to get : 
  
  <ul>
  <li>list of campaigns (of the user doing the request), </li>
  <li>statistics of a campaign, </li>
  <li>statistics for specific address, </li>
  </ul></li>
  <li>and.. that's all !</li>
  </ul>
  
  <p>Thank you very much if you've read it all, I hope to find a solution.</p>
  
  <p>Regards.</p>