doushan3511 2016-08-31 15:35
浏览 29
已采纳

如何在Mailjet活动中发送带有personnalmessage的测试电子邮件

I have a campaign and I send it with $mj->post to a contact list.

But I want to manage a test with the following code from the API

$response = $mj->post(Resources::$NewsletterTest, ['id' => $idNewsletter, 'body' => $body]);

But then I define the $body with a personnalmessage like this :

$body = [
    'Recipients' => [
        [
            'Email' => "myemail@myemail.com",
            'Name' => "John",
            'Vars' => [ 
            'personalmessage' => "Hello John this is a test"
            ]
        ]
    ]
];

I get the follwing error :

"Invalid json input:
object ".Recipients..item"->"TTestRecipient" has no property "Vars"" ["StatusCode"]=> int(400) 

And I do not understand how to correct the problem

  • 写回答

1条回答 默认 最新

  • dongshao5573 2016-09-01 08:33
    关注

    When using NewsletterTest, you can specify only email address and name for the test recipients and can not use variables - https://dev.mailjet.com/email-api/v3/newsletter-test/

    Personalisation is only available in Send API only - https://dev.mailjet.com/guides/#personalisation

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)