I have implemented gmail APIs and every thing working perfect if mime type is text/html
or text/plain
but if mime type is multipart/alternative
or any thing i am not able to get content.
Here is my code:
foreach ($message->getPayload()->getParts() as $part) {
if($part->getMimeType() == "text/plain"){
$email->body= $part->getBody()->getData();
}
elseif($part->getMimeType() == "text/html"){
$email->body= $part->getBody()->getData();
}
elseif($part->getMimeType() == "multipart/alternative"){
$email->body= $part->getBody()->getData();
}
else{
$email->body= $part->getBody()->getData();
}
}
Its not returning any thing.