Forum Email

By daniel - February 10, 2022

Hey Dan,

These placeholders for forum notifications are hard-coded, so in order to add more, you would need to update the plugin file directly. These placeholders are defined in two places in simpleForum.php - around lines 803 and 838 (the first for admin notifications, the second for follower notifications). For example, if you wanted to add the full message to the placeholders, you would change from this:

        'placeholders' => array(
          'admin.email'            => $adminEmail,
          'post.username'         => $CURRENT_USER['username'],
          'post.read_link'        => realUrl($post['_link']),
          'post.reply_link'       => realUrl($GLOBALS['SFORUM_POST_REPLY_URL']) . '?postNum=' . $post['num'],
          'post.unsubscribe_link' => realUrl($GLOBALS['SFORUM_POSTS_URL']) . '?unfollow=1&topicNum=' . $post['topicNum'],
          'post.message_snippet'  => sforum_getPostSnippet( $_REQUEST['message'] ),
          'topic.subject'         => $topic['subject'],
          'forum'                 => $forum['name'],
        )

to this:

        'placeholders' => array(
          'admin.email'            => $adminEmail,
          'post.username'         => $CURRENT_USER['username'],
          'post.read_link'        => realUrl($post['_link']),
          'post.reply_link'       => realUrl($GLOBALS['SFORUM_POST_REPLY_URL']) . '?postNum=' . $post['num'],
          'post.unsubscribe_link' => realUrl($GLOBALS['SFORUM_POSTS_URL']) . '?unfollow=1&topicNum=' . $post['topicNum'],
          'post.message_snippet'  => sforum_getPostSnippet( $_REQUEST['message'] ),
          'post.message'          => $_REQUEST['message'],
          'topic.subject'         => $topic['subject'],
          'forum'                 => $forum['name'],
        )

Which would make "#post.message#" placeholder available. 

Note that making changes to the plugin file like this would be overwritten when updating the plugin to a newer version, so I would recommend making notes of what changes you make and/or modifying the plugin folder to something like "simpleForum_custom" and reactivating the plugin to prevent automatic rewriting.

Let me know if you have any other questions!

Thanks,

Daniel
Technical Lead
interactivetools.com