mailjet / laravel-mailjet

Laravel package for Mailjet API V3 and Laravel Mailjet Mail Transport
MIT License
94 stars 93 forks source link

Status says sent, but nothing is received or recorded under message events. #70

Closed adampatterson closed 1 year ago

adampatterson commented 1 year ago

I am new to MailJet and the platform and could be doing something wrong, but I found the documentation to be a bit confusing.

I used this example.

It would be nice if the template example matched the sending example.

In the admin interface the JSON provided in the CURL body don't line up with the array sent by the package which seems odd.

I looked for other examples on GitHub and only found a few that were using Var instead of Variables

In any case, I get a successful response, but nothing is showing up in my Inbox, and the message events are not showing anything sent.

Any help would be much appreciated.

$mj = Mailjet::getClient();
$body = [
    'FromEmail' => "from@email.com",
    'FromName' => "Mailjet Pilot",
    'Subject' => "Your email flight plan!",
    'MJ-TemplateID' => 12345,
    'MJ-TemplateLanguage' => true,
    'Recipients' => [['Email' => "to@email.com"]],
    'Vars' => [
        'transaction_subject' => "your invoice is ready"
    ]
];
$response =  $mj->post(Resources::$Email, ['body' => $body]);
dd($response->success(), $response->getData());
true // routes/dev.php:337
array:1 [▼ // routes/dev.php:337
  "Sent" => array:1 [▼
    0 => array:3 [▼
      "Email" => "to@email.com"
      "MessageID" => 576460768801694577
      "MessageUUID" => "f61517b8-237a-4e74-b09b-70ec1276160b"
    ]
  ]
]

image

adampatterson commented 1 year ago

It seems like the Laravel package is using V3 while the PHP wrapper is using 3.1. 3.1 works with the JSON body provided by the Admin pannel after you convert the JOSN to valid JSON and then the PHP example uses the wrong Class path.

new MailjetClient(...); should be new \Mailjet\Client(...);

adampatterson commented 1 year ago

I don't think the transaction config settings are being used for transactional emails services.mailjet.transactional.options values.

Am I supposed to specify anything so that the correct API version is used?

oleksandr-mykhailenko commented 1 year ago

Hello @adampatterson What package do you mean when say about V3.1 ?

oleksandr-mykhailenko commented 1 year ago

Close due to incorrect settings