【问题标题】:Get a notification from SendGrid when an email is open电子邮件打开时从 SendGrid 获取通知
【发布时间】:2017-11-28 11:56:13
【问题描述】:

SendGrid 可以跟踪电子邮件的打开时间:

如何获得通知(通过电子邮件)打开电子邮件时,收件人与myself@gmail.com 不同? (我不想在我打开我自己作为密件抄送发送给自己的电子邮件时收到通知。

我需要使用 SendgridAPI 吗?如何?我可以要求 Sendgrid 发送通知吗? (到我的服务器,谁来发送通知?到别的地方?)

【问题讨论】:

    标签: sendgrid sendgrid-api-v3


    【解决方案1】:

    解决方案是进入仪表板>设置>邮件设置>事件通知

    那么这里有一个可能的eventlistener.php

    <?php
    
    $postdata = json_decode(file_get_contents("php://input"));
    
    foreach ($postdata as $event) 
    {
        if (($event->event === 'open') && ($event->email !== 'myself@gmail.com'))
        {
            mail('myself@gmail.com', 'Mail to ' . $event->email . ' opened', 'Opened.', "From: myself@gmail.com");
        }
    }
    
    ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多