-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update MailCare Request #95
Conversation
@mailcare is this still an issue? i can fix it in my fork: https://github.com/joelharkes/laravel-mailbox |
Yes still an issue, but the PR are not merged. I'm not sure Laravel mailbox is still used. |
Please accept this PR! 👍 |
@joalea and @siebsie23 Im trying to solve it but i dont understand how this code would solve it. When i read the documentation: https://mailcare.docs.apiary.io/#reference/0/automations-resource/automation-webhook it suggests getting the email from data.sender.email not from php://input |
@joelharkes To be honest I'm not sure. I just blindly merged it into my fork. But in theory the php://input should just get the full raw body of the email right? |
} | ||
|
||
public function email() | ||
{ | ||
return InboundEmail::fromMessage($this->get('email')); | ||
return InboundEmail::fromMessage(file_get_contents('php://input')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably this would do as well:
return InboundEmail::fromMessage(file_get_contents('php://input')); | |
return InboundEmail::fromMessage($this->post()); |
to get all input
As far as i understand, this would store the complete JSON in the see: https://mailcare.docs.apiary.io/#reference/0/email-resource/get-an-email |
Instead it seems like you have to checkbox the "Post the raw, full MIME message": https://github.com/mailcare/mailcare |
Yes it works only if you check the checkbox "Post the raw, full MIME message". A new PR has been created: #114 and it has been fully tested. |
@eXorus actually Im not sure there is a proper solution for this. |
But you don't need to have the http headers, you only need the email body and Laravel mailbox will decode the email for you. |
@eXorus the HTTP headers are equal to the Email headers, it contains who send the email and who received it ETC. So they are picked up as HTTP headers and you will only get the Email HTML body and miss all the email context information |
Sorry I don't understand, the other drivers works the same they send more information in a Json properties like subject or to but they are not used by laravel mailbox because Laravel mailbox use only the raw email (with email headers and bodies) to decode the subject... So same for MailCare but I don't send the decoded subject, because laravel mailbox don't need it. From a user point of view you will have all the emails headers and all the emails bodies. |
No, the email headers are filtered out by PHP (as they are identical as HTTP header structure they are seen as HTTP headers). I did some testing locally. When I have more time I'll make a proper PR to make it work in any circumstance although maybe not the ideal solution. |
@eXorus i was wrong it, does seem to POST the whole email message in the HTTP Body (it doesn not skip the HTTP request) |
@eXorus my Fork supports it now with proper testing also: https://packagist.org/packages/joelharkes/laravel-mailbox |
The MailCare driver doesn't work.
This PR will fix the issue.