'title' => $event->getEmailTitle()
]));
$email->addRecipient(new UserMailbox($user));
- // TODO: MessageID, References, In-Reply-To
$message = $event->getEmailMessage('instant');
if (is_array($message)) {
if (isset($message['variables'])) {
$variables['variables'] = $message['variables'];
}
+ if (isset($message['message-id'])) {
+ $email->setMessageID($message['message-id']);
+ }
+ if (isset($message['in-reply-to'])) {
+ foreach ($message['in-reply-to'] as $inReplyTo) $email->addInReplyTo($inReplyTo);
+ }
+ if (isset($message['references'])) {
+ foreach ($message['references'] as $references) $email->addReferences($references);
+ }
$html = new RecipientAwareTextMimePart('text/html', 'email_notification', 'wcf', $variables);
$plainText = new RecipientAwareTextMimePart('text/plain', 'email_notification', 'wcf', $variables);
*
* If $notificationType is 'instant' this method should either:
* - Return a string to be inserted into a text/plain email (deprecated)
- * - Return a ['template' => ..., 'application' => ..., 'variables' => ...] array
- * to be included into the summary email.
+ * - Return an ['template' => ...,
+ * 'application' => ...,
+ * 'variables' => ...,
+ * 'message-id' => ...,
+ * 'in-reply-to' => [...],
+ * 'references' => [...]]
+ * array to be included into the notification email.
+ * message-id, in-reply-to and references refer to the respective headers
+ * of an email and are optional. You MUST NOT generate a message-id if you
+ * cannot ensure that it will *never* repeat.
*
* If $notificationType is 'daily' this method should either:
* - Return a string to be inserted into the summary email (deprecated)
- * - Return a ['template' => ..., 'application' => ..., 'variables' => ...] array
+ * - Return an ['template' => ..., 'application' => ..., 'variables' => ...] array
* to be included into the summary email.
*
* @param string $notificationType
* @return mixed
+ * @see \wcf\system\email\Email
*/
public function getEmailMessage($notificationType = 'instant');