Changeset 1579

Show
Ignore:
Timestamp:
04/17/08 08:45:58 (3 months ago)
Author:
misja
Message:

Misja Hoebe <misja@curverider.co.uk> Fixes #341, send a notification when inviting a member to a community. Also adds a community:invite hook.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/community/invite.php

    r1539 r1579  
    9797                $x->friend = $invite_ident; 
    9898 
     99                // Add a callback 
     100                $x = plugin_hook('community:invite', 'publish', $x); 
     101                 
     102                if (empty($u)) { 
     103                    trigger_error("The community:invite callback didn't receive a return value.", E_USER_ERROR); 
     104                } 
     105                 
    99106                insert_record('friends_requests', $x); 
     107                 
     108                $community = get_record('users', 'ident', $profile_id ); 
     109 
     110            $message_body = sprintf(__gettext("You have been invited to join %s!\n\nTo visit this community's profile, click on the following link:\n\n\t%s\n\nTo view all your community invitation requests and approve or deny this user, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),$community->name, $CFG->wwwroot . $community->username . "/", $CFG->wwwroot . user_info("username",$invite_ident) . "/communities/invitations",$CFG->sitename); 
     111            $title = sprintf(__gettext("New %s community invitation"), $CFG->sitename); 
     112            notify_user($x->friend,$title,$message_body); 
    100113                 
    101114                $messages[] = __gettext("The user has been invited.");