We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$folders = [ $client->getFolder('INBOX'), ]; $sent = $client->getFolder("[Gmail]/Sent Mail"); $today = Carbon::today(); $yesterday = Carbon::today()->subDays(1); foreach ($folders as $folder) { $messages = $folder->query()->since($yesterday)->from($toEmail)->to($fromEmail)->all()->get(); foreach ($messages as $message) { $emailThreads[] = [ 'from_email' => $message->getFrom()[0]->mail, 'to_email' => $message->getTo()[0]->mail, 'to_name' => $message->getTo()[0]->full, 'from_name' => $message->getFrom()[0]->full, 'subject' => $message->getSubject()[0], 'body' => $message->getHTMLBody(), 'reply_date' => $message->getDate()[0]->toDateTimeString(), 'message_id' => $message->getAttributes()['message_id'][0], 'refrence_id' => isset($message->getAttributes()["references"][0]) ? $message->getAttributes()["references"][0] : '', 'check_attachment' => $message->hasAttachments(), 'attachment' => $message->getAttachments(), 'date' => $message->getDate()->toDate(), ]; } } This is my logic to fetch the emails in the inbox folder I want the whole thread of it to help me to solve this
The text was updated successfully, but these errors were encountered:
No branches or pull requests
$folders = [
$client->getFolder('INBOX'),
];
$sent = $client->getFolder("[Gmail]/Sent Mail");
$today = Carbon::today();
$yesterday = Carbon::today()->subDays(1);
foreach ($folders as $folder) {
$messages = $folder->query()->since($yesterday)->from($toEmail)->to($fromEmail)->all()->get();
foreach ($messages as $message) {
$emailThreads[] = [
'from_email' => $message->getFrom()[0]->mail,
'to_email' => $message->getTo()[0]->mail,
'to_name' => $message->getTo()[0]->full,
'from_name' => $message->getFrom()[0]->full,
'subject' => $message->getSubject()[0],
'body' => $message->getHTMLBody(),
'reply_date' => $message->getDate()[0]->toDateTimeString(),
'message_id' => $message->getAttributes()['message_id'][0],
'refrence_id' => isset($message->getAttributes()["references"][0]) ? $message->getAttributes()["references"][0] : '',
'check_attachment' => $message->hasAttachments(),
'attachment' => $message->getAttachments(),
'date' => $message->getDate()->toDate(),
];
}
}
This is my logic to fetch the emails in the inbox folder I want the whole thread of it to help me to solve this
The text was updated successfully, but these errors were encountered: