CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Major Feature #4962

Email-able Latest Report

Added by Chris Paige over 3 years ago. Updated over 2 years ago.

Status:Accepted Start date:2009-10-10
Priority:Could have Due date:
Assignee:Martin Helmich % Done:

0%

Category:Cronjobs
Target version:1.10.0 Estimated time:6.00 hours
Votes: 0

Description

If have seen another forum program (specifically GroupSites.com) that includes a function where users are emailed at some frequency (e.g. weekly) with an email showing new topics and recent activity. The feature encourages user engagement by keeping them posted of recent activity more comprehensively.

Reporting should be very similar to the mm_forum Latest report (using timestamp to query, instead of a number of posts), but will need to manage user permissions differently in order to produce appropriate emails per user.

I will be working on such a feature, but wanted to invite feedback or ideas. I may request some new hooks or other adjustments in the process.

T3X_mmforum-notify-0_0_0-z-200910121718.t3x (5.8 kB) Chris Paige, 2009-10-12 23:31

History

Updated by Martin Helmich over 3 years ago

  • Status changed from New to Needs Feedback

Hey Chris,

this sounds like a great idea. Do you plan to implement this feature as a seperate extension or do you want to integrate it into the mm_forum core?
Will users be able to enable/disable these notifications for themselves if they to not want them?

Martin

Updated by Chris Paige over 3 years ago

I started working on it as a seperate extension, still utilizing existing functions, in order to minimize problems and simplify maintenance. However, it looks like it would be much simpler to just add it in as a new class/option among other existing cron jobs.

The user would adjust timing with a new field, parallel to PM notify. Instead of PM notify, this is post notify. It will require some minor adjustment to be able to use function getMayRead_forum_query and function getMayRead_forum to assess permissions per user on the out-going emails.

I have a partly functional version now. Will probably need other hands to make it versatile enough for integration, but I hope to have a proof of concept soon.

Updated by Chris Paige over 3 years ago

Ok, here's an initial version for review. It could probably be cleaned up by someone more familiar with mm_forum.

TO TEST

The attached extension needs to be installed, only to add in the new fe_user field (db and TCA) to regulate whether that user receives the report or not. This could be eliminated, by adding relevant lines into main mm_forum files. TCA allows for both weekly and daily report options, but code only produces weekly reports right now.

The two files in the cron section need to be copied into their locations in mm_forum...
typo3conf/ext/mmforum-notify/cron/classes/class.tx_mmforum_cron_notify.php into typo3conf/ext/mm_forum/cron/classes
typo3conf/ext/mmforum-notify/cron/lang/lang.tx_mmforum_cron_notify.php into /public_html/typo3conf/ext/mm_forum/cron/lang

Then two additions to typo3conf/ext/mm_forum/pi1/class.tx_mmforum_pi1.php in getMayRead_forum_query, which allow this existing function to be used to calculate permissions for a designated user, instead of the current session's fe_user.

function getMayRead_forum_query($prefix="") {

  /* Get user UID */
  $userId = $this->getUserID();        
  if ($this->conf['mmforum-notify']) {                      //add this line
    $userId = $this->conf['mmforum-notify'];                //add this line
  }                                                         //add this line
/* Get all groups the current user is a member of. */
$groups = $GLOBALS['TSFE']->fe_user->groupData['uid'];
if ($this->conf['mmforum-notify']) {                                      //add this line
  $group_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(                    //add this line
    'usergroup',                                                      //add this line
    'fe_users',                                                       //add this line
    'uid ='.$this->conf['mmforum-notify']                             //add this line
   );                                                                     //add this line
  if($group_arr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($group_res)) {    //add this line
    $groups=explode(',',$group_arr['usergroup']);                         //add this line
  }                                                                       //add this line
}                                                                         //add this line
$groups = tx_mmforum_tools::processArray_numeric($groups);

Updated by Chris Paige over 3 years ago

Naturally, the cron job also needs to be set up, as normal with other mm_forum cron functions...

Updated by Chris Paige over 3 years ago

Further development notes:

1 - Default for post-notify field should probably be 1 for weekly updates, instead of 0 for no updates

2 - Need to decide how to pass template location. Current version has template hard-coded. Probably needs to be integrated into the mm_forum ts listed in typo3conf. Or should more be done with the Language files?

3 - Need to decide how to handle daily vs. weekly cron jobs. Use an argument so weekly is scheduled with seperate cron job from daily? Maybe better to have mm_forum setup include day of the week when weekly report should run. So cronjob would be daily and once a week, on the relevant day, the weekly report would also fire.

4 - The weekly report, probably bears the need for more markers. The emails should include more opt-out information than would a PM notify. So a marker for ###USEREMAIL### would be good, along with site name, site URL.

Updated by Martin Helmich over 3 years ago

  • Category set to Cronjobs
  • Status changed from Needs Feedback to Accepted
  • Assignee set to Martin Helmich
  • Target version set to 1.10.0
  • Estimated time set to 6.00

Hey Chris,

sorry it took so long. We will try to integrate this feature into one of the next versions.

Martin

Also available in: Atom PDF