电子邮件已打开/未从Node.js nodemailer跟踪 [英] Email opened/not tracking from nodejs nodemailer

查看:82
本文介绍了电子邮件已打开/未从Node.js nodemailer跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所知道的

我想在我的一个网站中实施打开/不跟踪的电子邮件.搜索后,我发现通过与电子邮件一起发送嵌入式图像(通常为1 px透明)来完成电子邮件打开/不跟踪的操作.当有人打开电子邮件,并且如果他们允许使用图片时,我们就会收到图片的要求并进行跟踪.

I want to implement the email opened/not tracking in one of my websites. after searching i found that email-opened/not tracking is done by sending an embedded image along with email(typically 1 px transparent). when some one opens the email and if they allow images then we get a req for the image and we track that.

我正在用什么来实现我所知道的

我在项目中使用MEAN堆栈,在使用Amazon ses作为发送服务的nodemailer中使用nodemailer进行发送.

I am using MEAN stack for the project and nodemailer for sending emails with amazon ses as sending service.

问题

我能够使用上述技术发送嵌入的图像,但是问题出在节点邮件程序中,您必须将图像作为电子邮件附件附加到嵌入的图像上.因此,没有来自邮件客户端的呼叫返回到我在图像文件中提到的回调URL(因为电子邮件客户端已经具有该文件).我如何实现它来跟踪已打开/未打开的邮件.如果使用nodemailer无法做到这一点,请指出正确的方向.

I am able to send the embedded images using above technologies but the problem is in node mailer, you have to attach the image as email-attachment to embedded images. so , no call from mail client is returning to the callback-url i mentioned in image file (as email client already have the file). how do i implement it to track mail opened/not. If this cannot be done with nodemailer, please point me in the right direction.

我的专业知识

我仍然是一个初学者,因此,如果上述问题有误,请原谅并纠正我.

I am still a beginner, so kindly forgive and correct me if something above is wrong.

推荐答案

我不确定100%是否确定发布的正确方法,但是我想出了一种使其正常工作的方法.由于此帖子一直没有得到任何有效的答案,而且我看到有人在查看它,所以我在回答自己的问题

I am not 100% sure if what i am posting is the correct way to do it but i figured out a way to make it work. Since this post did not get any valid answer all this time and i see some people viewing it i am answering my own question

如果您使用node-mailer将1px图片连同电子邮件作为附件发送,则无法跟踪电子邮件的打开,因为它将自动呈现并随邮件一起发送文件.(未对服务器进行外部呼叫=您无法检测到) .像通常一样,使用node-mailer渲染HTML,并向服务器中的路由输入带有源的图片,如下所示

You cannot track the opening of email if you send the 1px pic along with email as attachments using node-mailer as it will automatically render and send the file along with mail.(no external call made to server = you cannot detect). Render HTML using node-mailer as you do generally and input a pic with source to a route in your server like shown below

<html>
   <body>
      <img src="http://YOUR_SITE.com/track/this/image/UNIQUE_ID_FOR_THIS_IMAGE.jpg">
   </body>
</html>

现在,您的节点邮件程序中没有附件,该文件也不会与电子邮件一起发送,而是会在有人打开电子邮件时被提取并呈现.

Now you have no attachments in your node-mailer and the file is not sent along with email, but will be fetched to render when someone opens the email.

您可以使用url中的唯一键跟踪谁打开了电子邮件.

You can track who opened the email using the unique key in url.

P.S.不要忘了将(1x1)px img文件发回给请求.这样客户端不会发生404错误.

P.S. Don't forget to send a (1x1)px img file back for the request. so that no 404 error occurs on the client side.

这篇关于电子邮件已打开/未从Node.js nodemailer跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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