Hallo zusammen,
ich verwende das mm_forum auf einer Webseite und leider wird bei einer Emailbenachrichtigung nicht der Inhalt des jeweiligen Posts in der Email verschickt.
Gibt es eine Möglichkeit das zu realisieren?
Vielen Dank im Voraus!
Hallo zusammen,
ich verwende das mm_forum auf einer Webseite und leider wird bei einer Emailbenachrichtigung nicht der Inhalt des jeweiligen Posts in der Email verschickt.
Gibt es eine Möglichkeit das zu realisieren?
Vielen Dank im Voraus!
Hi, das ist meines Wissens nach nicht ohne den Quellcode zu modifizieren möglich, sorry.
Dein Freund dürfte die pi1/class.tx_mmforum_havealook.php sein.
Ich bin mir jetzt nicht sicher, ob ein Feature Request auf forge.typo3.org erfolgreich wäre, aber mit einem passendem Patch wäre es sicherlich einfacher, das aufzunehmen.
Grüße, Ines
ich hab bei uns auch die 2 Funktionen Topic und Category Subscriber umgebaut:
1. Versand der Email als HTML und Plain text
2. Mit dem Text der antwort und dem Namen des Antwortenden (weil in einem kleinem Forum kennt man sich, und weis dann schon deutlich besser, wie wertvoll die antwort ist )
(und 3. noch, aber den Codeteil hab ich im Beispiel entfernt) eine global definierte Signatur ..
function notifyTopicSubscribers($topicId, $forumObj) {
$topicId = intval($topicId);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('topic_title', 'tx_mmforum_topics', 'uid = ' . $topicId . $forumObj->getStoragePIDQuery());
list($topicName) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$sender = $forumObj->conf['notifyingMail.']['sender'];
if (!preg_match('/<([^><@]*?)@([^><@]*?)>$/',$forumObj->conf['notifyingMail.']['sender'])) {
$sender = $forumObj->conf['notifyingMail.']['sender'] . ' <' . $forumObj->conf['notifyingMail.']['sender_address'] . '>';
}
$Typo3_htmlmail = t3lib_div::makeInstance("t3lib_htmlmail");
$Typo3_htmlmail->start();
$Typo3_htmlmail->from_email = $forumObj->conf['notifyingMail.']['sender_address'];
$Typo3_htmlmail->from_name = $forumObj->conf['notifyingMail.']['sender'];
$Typo3_htmlmail->returnPath = $forumObj->conf['notifyingMail.']['sender_address'];
$Typo3_htmlmail->replyto_email = $Typo3_htmlmail->from_email;
$Typo3_htmlmail->replyto_name = $Typo3_htmlmail->from_name;
$Typo3_htmlmail->organisation = "";
$Typo3_htmlmail->priority = 3;
$template = $forumObj->pi_getLL('ntfMail.text');
$linkParams[$forumObj->prefixId] = array(
'action' => 'open_topic',
'id' => $topicId
);
$link = $forumObj->pi_getPageLink($GLOBALS['TSFE']->id, '', $linkParams);
$link = $forumObj->tools->escapeBrackets($link);
if (strlen($forumObj->conf['notifyingMail.']['topicLinkPrefix_override']) > 0) {
$link = $forumObj->conf['notifyingMail.']['topicLinkPrefix_override'] . $link;
} else {
$link = $forumObj->tools->getAbsoluteUrl($link);
}
// convert link to HTML Link .. for plain message this tags will be deleted afterwards ...
$link = "<br>\n<br>\n<a href=\"" . $link . "\">" . $link . "<a/><br>\n<br>\n" ;
//w.f.29.06.11 adding of message and username for the email
$topicPosterUsername = $GLOBALS['TSFE']->fe_user->user['username'];
$message = strip_tags($forumObj->piVars['message']);
$pattern = "|[[\/\!]*?[^\[\]]*?]|si";
$replace = "";
$message = preg_replace($pattern, $replace, $message);
$marker = array(
'###TOPICPOSTERUSERNAME###' => $topicPosterUsername,
'###POST###' => $message,
'###LINK###' => $link,
'###TOPICNAME###' => $topicName,
'###BOARDNAME###' => $forumObj->conf['boardName']
);
// get all users on this topic
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'DISTINCT m.user_id, u.email, u.' . $forumObj->getUserNameField(),
'tx_mmforum_topicmail m, fe_users u',
'm.user_id = u.uid AND m.topic_id = ' . $topicId .
' AND u.deleted = 0 AND u.email != "" AND u.disable = 0 AND m.user_id != ' . intval($GLOBALS['TSFE']->fe_user->user['uid']) . $forumObj->getStoragePIDQuery('m')
);
// get the html Email tempalte
$this->templateCode = $forumObj->cObj->fileResource($this->conf["MailTemplateFile"]);
if (!$this->templateCode ) {
$this->templateCode = $forumObj->cObj->fileResource("fileadmin/templates_connect/extensiontemplates/mail/mail.html") ;
}
// get the singature
// loop through each user who subscribed
while (list($toUserId, $toEmail, $toUsername) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
$marker['###USERNAME###'] = $forumObj->escape($toUsername);
$mailtext = $forumObj->cObj->substituteMarkerArrayCached(nl2br($template), $marker);
// Compose mail and send
if (!empty($toEmail)) {
$llMarker = array(
'###TOPICNAME###' => $forumObj->escape($topicName),
'###BOARDNAME###' => $forumObj->escape($forumObj->conf['boardName'])
);
$subject = $forumObj->pi_getLL('ntfMail.subject');
// Include hooks
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['newPostMail_contentMarker'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['newPostMail_contentMarker'] as $_classRef) {
$_procObj = &t3lib_div::getUserObj($_classRef);
$llMarker = $_procObj->newPostMail_contentMarker($llMarker, $row, $forumObj);
}
}
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['newPostMail_subject'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['newPostMail_subject'] as $_classRef) {
$_procObj = &t3lib_div::getUserObj($_classRef);
$subject = $_procObj->newPostMail_subject($subject, $row, $forumObj);
}
}
$subject = $forumObj->cObj->substituteMarkerArray($subject, $llMarker);
// generate $htmlMail and Plain Message from $mailtext
$plain_message = strip_tags( str_replace (array("<br>", "<br />", "<br/>", "<BR>", "<BR/>","<BR />","<p>","<P>"),
array("\n","\n","\n","\n","\n","\n","\n","\n") ,
$mailtext ) ) ;
$emailMarkerArray['###HEADLINE###'] = $subject;
$emailMarkerArray['###TEXT###'] = $mailtext;
$htmlMail = $forumObj->cObj->substituteMarkerArray($this->templateCode, $emailMarkerArray);
$Typo3_htmlmail->subject = $subject;
$Typo3_htmlmail->setPlain($Typo3_htmlmail->encodeMsg($plain_message));
$Typo3_htmlmail->setHtml($Typo3_htmlmail->encodeMsg($htmlMail));
$Typo3_htmlmail->fetchHTMLMedia();
$Typo3_htmlmail->substMediaNamesInHTML(0);
$Typo3_htmlmail->setHeaders();
$Typo3_htmlmail->setContent();
$Typo3_htmlmail->setRecipient($toEmail);
$Typo3_htmlmail->send($toEmail) ;
}
}
}