{"id":70557,"date":"2019-09-30T12:00:50","date_gmt":"2019-09-30T10:00:50","guid":{"rendered":"https:\/\/de.wordpress.org\/support\/topic\/admin-kommentar-email-anpassen\/"},"modified":"2019-09-30T12:00:50","modified_gmt":"2019-09-30T10:00:50","slug":"admin-kommentar-email-anpassen","status":"publish","type":"topic","link":"https:\/\/de.wordpress.org\/support\/topic\/admin-kommentar-email-anpassen\/","title":{"rendered":"Admin Kommentar Email Anpassen"},"content":{"rendered":"<p>Hey Leute, ich habe ein Problem. Wenn ein User einen Kommentar absendet, bekommt der Admin (oder alle die als admin im wp eingetragen sind) eine Email. Dies Funktionier bei uns wunderbar. Nun haben wir unser Kommentarfeld etwas angepasst und paar sachen wurden entfernt. (URL). Hinzugekommen ist der Nachname und und eine Checkbox. Soweit alles super. <\/p>\n<p>Wir wollen die Email welche wp sendet wenn ein User das Kommentarfeld ausf\u00fcllt und absendet Modifizieren oder anpassen. Hierf\u00fcr wollte ich folgende code nutzen:<\/p>\n<pre><code>\nfunction comment_moderation_text( $notify_message, $comment_id ){\n    \/\/ get the current comment and post data\n    $comment = get_comment( $comment_id );\n    $post = get_post( $comment-&gt;comment_post_ID );\n\n    \/\/ don&#039;t modify trackbacks or pingbacks\n    if( &#039;&#039; == $comment-&gt;comment_type ){\n        \/\/ build the new message text\n        $notify_message  = sprintf( __( &#039;New comment on your post &quot;%s&quot;&#039; ), $post-&gt;post_title ) . &quot;\\r\\n&quot;;\n        $notify_message .= sprintf( __(&#039;Author : %1$s&#039;), $comment-&gt;comment_author ) . &quot;\\r\\n&quot;;\n        $notify_message .= sprintf( __(&#039;E-mail : %s&#039;), $comment-&gt;comment_author_email ) . &quot;\\r\\n&quot;;\n        $notify_message .= __(&#039;Comment: &#039;) . &quot;\\r\\n&quot; . $comment-&gt;comment_content . &quot;\\r\\n\\r\\n&quot;;\n        $notify_message .= __(&#039;You can see all comments on this post here: &#039;) . &quot;\\r\\n&quot;;\n        $notify_message .= get_permalink($comment-&gt;comment_post_ID) . &quot;#comments\\r\\n\\r\\n&quot;;\n        $notify_message .= sprintf( __(&#039;Permalink: %s&#039;), get_comment_link( $comment_id ) ) . &quot;\\r\\n&quot;;\n        $notify_message .= __(&#039;dein Testkommentar: &#039;). &quot;\\r\\n&quot;;\n\n        $notify_message .= sprintf(__(&#039;datenschutz: %s&#039;), &#039;Ich willige in die Ver\u00f6ffentlichung meiner Frage, meines Vornamens, dem ersten Buchstaben meines Nachnamens und meines Anfragezeitpunktes auf der Webseite Wolfsblut.com und den Facebook-Seiten der Healthfood24 GmbH ein.&#039;);\n        $notify_message .= current_time();\n\n        if ( user_can( $post-&gt;post_author, &#039;edit_comment&#039;, $comment_id ) ) {\n            if ( EMPTY_TRASH_DAYS )\n                $notify_message .= sprintf( __(&#039;Trash it: %s&#039;), admin_url(&quot;comment.php?action=trash&amp;c=$comment_id&quot;) ) . &quot;\\r\\n&quot;;\n            else\n                $notify_message .= sprintf( __(&#039;Delete it: %s&#039;), admin_url(&quot;comment.php?action=delete&amp;c=$comment_id&quot;) ) . &quot;\\r\\n&quot;;\n            $notify_message .= sprintf( __(&#039;Spam it: %s&#039;), admin_url(&quot;comment.php?action=spam&amp;c=$comment_id&quot;) ) . &quot;\\r\\n&quot;;\n        }\n    }\n    \/\/ return the notification text\n    return $notify_message;\n\n}\nadd_filter( &#039;comment_notification_text&#039;, &#039;comment_moderation_text&#039;, 10, 2 );\n<\/code><\/pre>\n<p>Jedoch egeal ob ich es in einem Plugin einf\u00fcge oder in die Functions.php des Themes greift der filter nicht bei der Administrations EMail. Kann mir vielleiht jemand helfen wie ich die Admin Email, genauer gesagt, den notify_message teil anpassen kann?<\/p>\n<p>Vielen f\u00fcr die Hilfe im Voraus.<\/p>\n","protected":false},"template":"","class_list":["post-70557","topic","type-topic","status-publish","hentry","topic-tag-admin-email","topic-tag-kommentar"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/de.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/70557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/de.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/de.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/de.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/70557\/revisions"}],"wp:attachment":[{"href":"https:\/\/de.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=70557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}