最有效的方式来发送简讯 [英] Most efficient way to send newsletters
问题描述
今天,当我发送邮件的基本,我用的是邮件类,这是使用SwiftMailer一个定制的包装,像这样:
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 :
- 无池管理
- 无延迟发送
- 没有跟踪
于是,我想到了一个方法来集中更复杂的电子邮件管理。我做了一个模式:
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:
在数据的领域的收件人表是这里存储在API请求有关收件人的信息,这将被送回自定义的数据结构。例如:
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.
它仅prevent用户访问它没有自己的数据,和prevent非管理员用户访问管理员API方法(如创建用户)。
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).
这种方式是很容易在任何网站集成,我只需要存储帐户的API密钥我想与发送邮件(就像在我加入了 mailing_api_key 场用户实体为例)。
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).
首先,你觉得这个怎么样的架构?
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 :
- 会被列入黑名单,
- 有坏的统计结果,因为我不知道任何其他方式来跟踪看法比使用跟踪图像,这是非常容易堵,
- 检测反弹从我读过似乎pretty复杂,我已经与它没有任何经验。
所以,我做了一些研究,找到专业化的服务,可以解决这个问题,这样的:
So I've done some researches to find specialized services which can handle this, like :
- Mailchimp
- Sendinblue
- MPZMail
- Campayn
- FreshMail
等等。但他们都希望管理联系人和很多事情我不关心的。
and so on.. But all of them wants to manage contacts and a lot of things I don't care of.
我只想要一个服务的与所有,我上面描述的做一些事情接近于无UI:
I just want a service with no UI at all, that do something close to what I've described above:
- 动态帐户创建(仅适用于管理员帐户),
- 每次发送电子邮件到地址的自定义列表,没有限制,没有任何形式的pre创建邮件列表
- 简单的方法来获得:
- 系列列表(用户所做的请求),
- 竞选的统计,
- 的具体地址统计,
非常感谢你,如果你读过这一切,我希望能够找到一个解决方案。
Thank you very much if you've read it all, I hope to find a solution.
问候。
推荐答案
大多数(大)公司只是使用第三方API像mailchimp。只是订阅一些公司的通讯,并期待在电子邮件标题。
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).
这些第三方通讯公司提供的,你可以在PHP集成的API。
those third party newsletter companies provide an api that you can integrate in php.
这篇关于最有效的方式来发送简讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!