最有效的方式发送通讯 [英] Most efficient way to send newsletters

查看:147
本文介绍了最有效的方式发送通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,当我发送基本的电子邮件时,我使用一个邮件类,这是一个使用SwiftMailer的自定义包装器,如下所示:

 <?php 
Mail :: create('Message title')
- > template('模板字符串或视图路径全局变量var是{var}。当前用户是{username}。')
- >标签(array('var'=>'value 1'))
- >来自('contact@mydomain.com')
- > to(beail@example.com',array('username'=>'Boris'))
- > transport(Mail :: SMTP)
- >发送();

对于基本的电子邮件,它工作正常,但由于多种原因不能用于发送简报: p>


  • 没有池管理

  • 没有延期发送

  • 没有跟踪



所以我想到了一种集中更复杂的电子邮件管理的方法。我做了一个模式:





我不希望远程服务器存储任何联系信息,只有广告系列,收件人和统计信息,如下图所示: p>



收件人表中的数据字段在此存储要求API提供信息时将发回的自定义数据结构关于收件人。例如:

 <?php 
$ result = NewsletterAPI :: getRecipientsViewReport($ campaignRef);
//
//将包含以下内容:
// Array
//(
// [recipient] => Array
// (
// [0] => Array
//(
// [email] => toto@gmail.com
// [打开] => 3
// [last_open_date] =>'2015-02-02 12:32:23',
// [data] => Array
//(
// [id] => 123
//)
//)
// [1] => Array
//(
// [电子邮件] => tata@hotmail.com
// [打开] => 0
// [last_open_date] => null,
// [data] =>
//(
// [id] => 17
//)
//)
//)
//)

远程服务器不关心发送电子邮件并获取统计信息。无论电子邮件地址背后有哪些实体或用户的管理方式。



它只阻止用户访问不拥有的数据,并阻止非管理员用户访问管理API方法(如创建用户)。



这样可以很容易地整合到任何网站上,我只需要存储我要发送的帐户的api密钥邮件(例如在我的用户实体中添加 mailing_api_key 字段)。



我的问题



首先,你对这个架构有什么看法?



在现实世界的使用中,电子邮件的数量不应该非常巨大(每周数千),但我希望系统是最小的。除此之外,我可以想到三个主要问题:




  • 被列入黑名单,

  • 由于我不知道任何其他方式跟踪视图而不是使用跟踪图像,因此很难阻止,




所以我已经看到做了一些研究,找到可以处理这一点的专门服务,如:





等等..但是他们都想管理联系人和很多我不在乎的事情。



我只想要一个没有UI的服务 ,这些功能与上述内容相似:




  • 创建动态帐户(仅限管理员帐户),

  • 每次将邮件发送到自定义的地址列表, strong>没有限制,没有任何预先创建的邮件列表,

  • 轻松获取方式:


    • 执行请求的用户的广告系列列表,

    • 广告系列的统计信息,

    • 特定地址的统计信息, li>

  • 这是所有!



非常感谢你,如果你已经阅读了这一切,我希望找到一个解决方案。



问候。

解决方案

大多数(大)公司只是使用第三方API,如mailchimp。只需订阅一些公司通讯,并查看电子邮件标题。



有一个原因,如果预算超过数百万的公司将使用第三方通讯公司。垃圾邮件过滤器和您还不了解的问题,您将遇到很多麻烦...在不同的国家甚至有不同的法律。 (例如:在德国,您必须在电子邮件中提供取消订阅的链接)。



这些第三方通讯公司提供了一个可以集成到PHP中的API。


Today when I'm sending basic emails, I use a "Mail" class which is a custom wrapper using SwiftMailer, like so :

<?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 fine for basic emails but can't be used to send newsletters for multiple reasons :

  • No pool management
  • No deferred sending
  • No tracking

So I thought about a way to centralize more complex email management. I made a schema :

I don't want the distant server to store any contact information, only campaigns, recipients and statistics, like the following diagram:

The "data" field of the "Recipient" 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 :

<?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
//            )
//        )
//    )
// )

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.

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).

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 "mailing_api_key" field in my "User" entity for example).

So my question

First of all, what do you think about this architecture ?

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.

Aside of that, there are three main problems that I can think of :

  • Being blacklisted,
  • 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,
  • Detect bounces seems pretty complex from what I've read and I've no experience with it.

So I've done some researches to find specialized services which can handle this, like :

and so on.. But all of them wants to manage contacts and a lot of things I don't care of.

I just want a service with no UI at all, that do something close to what I've described above:

  • Dynamic account creation (only for admin account),
  • Send emails to a custom list of addresses each time, with no limit and no pre-created mailing list of any sort,
  • Easy way to get :
    • list of campaigns (of the user doing the request),
    • statistics of a campaign,
    • statistics for specific address,
  • and.. that's all !

Thank you very much if you've read it all, I hope to find a solution.

Regards.

解决方案

Most (big) companies just use a third party API like mailchimp. Just subscribe to a few company newsletter and look at the email header.

There is a reason if companies with a budget over millions will use thirdparty newsletter companies. You will have a lot of trouble with spam filters and problems you do not know yet ... there are even different laws in different countries. (example: in germany you must provide an unsubscribe link within the email).

those third party newsletter companies provide an api that you can integrate in php.

这篇关于最有效的方式发送通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆