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

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

问题描述

今天,当我发送基本电子邮件时,我使用Mail"类,它是使用 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.

它只会阻止用户访问不属于它的数据,并阻止非管理员用户访问管理员 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 密钥(例如在我的<强>用户"实体例如).

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 :

  • 被列入黑名单,
  • 有糟糕的统计结果,因为除了使用跟踪图像之外,我不知道任何其他跟踪视图的方法,而且很容易被阻止,
  • 从我读过的内容来看,检测反弹似乎非常复杂,而且我没有这方面的经验.

所以我做了一些研究来找到可以处理这个问题的专业服务,比如:

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:

  • 动态帐户创建(仅适用于管理员帐户),
  • 每次都将电子邮件发送到自定义地址列表,没有限制,也没有任何类型的预先创建的邮件列表
  • 简单的获取方式:
    • 活动列表(执行请求的用户),
    • 活动统计数据,
    • 特定地址的统计数据,

    非常感谢您阅读全文,希望能找到解决方案.

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

    问候.

    推荐答案

    大多数(大)公司只使用像 mailchimp 这样的第三方 API.只需订阅一些公司通讯并查看电子邮件标题即可.

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

    那些第三方通讯公司提供了一个 api,您可以将其集成到 php 中.

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

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

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