I have a chat system were notifications about the chat are send to the emailadreses which are involved. I would like to imitate the effect of conversation stacking in the receiver's inbox. Is there a way to do this?
I tried:
$headers = [
'Thread-Topic' => $subject
];
wp_mail( 'test@test.com', $subject, $content, $headers);
and
wp_mail( 'test@test.com', 'RE: '.$data['onderwerp'], $content );
and
$headers = [
'Message-ID' => 'custommailsystem'
];
wp_mail( 'test@test.com', $subject, $content, $headers);
Sending emails works, but they do not stack as one conversation in the receiver's inbox. They show up as separate mails, like this:
To make sure the receiver gets the emails in a organised way, I want emails to stack like this in the receiver's inbox:
Which headers are used to achieve the stacking in the mail? What determines in which conversation an email belongs?