Skip to content
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

Accessing the ID of an inbound email #48

Open
JapSeyz opened this issue Nov 16, 2019 · 2 comments
Open

Accessing the ID of an inbound email #48

JapSeyz opened this issue Nov 16, 2019 · 2 comments

Comments

@JapSeyz
Copy link

JapSeyz commented Nov 16, 2019

Hi,

I'd like to store some incoming mails after parsing them, but I'd like to have a reference to them in the data I create from the parsed mail. IE the model ID the InboundEmail model that I get in my Mailbox (not the mail ID).

The InboundEmail is not yet persisted once it reaches my mailbox, is there any issues with calling $inboundEmail->save(); within the mailbox?
This would allow me to get the ID and store the reference to the raw mail.

Cheers,

@pecuchet
Copy link

pecuchet commented Dec 8, 2020

Hello,

Your question is a little old, but since it has no answer and I'm facing a similar situation - I need the Email's id in my mailbox route handler. There is no issue in calling $inboundEmail->save(); there, apart from the fact that it duplicates the call in Routing/Router::storeEmail() (which is called after the route handler - there).

Is there a reason, @mpociot, why storeEmail() is not called before the route handler?

Another solution would be the message_id attribute, but that is only assigned upon the model's creating event... That is, while saving, which boils down to the same problem.

@joelharkes
Copy link

@pecuchet & @JapSeyz could you not access the the id's in the created eloquent event?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants