Closed maher1337 closed 1 year ago
I've never used Octane but I don't know why it wouldn't work. I am running all of my stuff in Docker containers and this package works without any issues. What are your symptoms?
When I'm running using artisan serve, the sent_emails table gets populated and everything is in place. however with Octane it does not insert any email log and I can not seem to the trace the error because there is none that's thrown.
Interesting. Do you know if Octane does anything to override the swift mailer? Again, I really don't know what Octane might be doing but if it's not working then either the swift mailer is getting loaded later in the Octane environment or somehow the MailTrackerServiceProvider is not getting called.
I think the reason behind this is if you look at the register() function in class MailTrackerServiceProvider I think the package has to be registred for it to run on Octane.
I'm not 100% sure of how the package is built I need more time to analyze the code. However if I push the email to a rabbitMQ queue and the worker handles the email it works perfectly fine as supposed to.
I think that this is an issue with the amazon sdk. We use mailcoach for newsletters, and here are also problems with octane and the tracking of SNS webhooks.
I am not sure what needs to be changed to make this work in Octane. If the mailer is getting rebooted every time but the service provider is not, then it may be something you need to add to your application to hook in the swift mailer plugin freshly one every request that you need to send mail to. Unless you all have an idea or pull request that resolves this, I'm going to close this issue.
I had a problem with the code called by vendor/aws/aws-php-sns-message-validator/src/Message.php
in the line that tries to get file_get_contents('php://input')
, because in Octane it doesn't It worked.
A suggestion to resolve the issue would be to modify vendor/jdavidbakr/mail-tracker/src/SNSController.php
by modifying the $message = SNSMessage::fromRawPostData();
part to:
// get body from request
$body = $request->getContent();
// Make sure the SNS-provided header exists.
if (!isset($_SERVER['HTTP_X_AMZ_SNS_MESSAGE_TYPE'])) {
throw new \RuntimeException('SNS message type header not provided.');
}
$message = SNSMessage::fromJsonString($body);
That does look more Laravel-correct. Feel free to submit a PR.
The package seems not be working with octane currently, correct me if I'm wrong thank you!