Changeset 1079

Show
Ignore:
Timestamp:
09/17/06 02:01:18 (2 years ago)
Author:
jm3
Message:

added email notification when someone adds you as a contact

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/contacts/add.php

    r427 r1079  
    1818<% 
    1919                add_contact( $user, $u ); 
     20                notify_added_as_peep( $user, $u ); 
    2021%> 
    2122 
  • feedmelinks/modules/utils.inc.php

    r1077 r1079  
    44include_once( "env.inc.php" ); 
    55include( get_root() . "/modules/prep-cache.inc.php" ); 
     6 
     7function notify_added_as_peep( $u, $by ) { 
     8        $body = "Hi, $u. 
     9 
     10$by just added you as a fellow linker on Feed Me Links. 
     11 
     12To browse $by's links or add $by to your peeps, click http://feedmelinks.com/u/$by  
     13 
     14Bye! 
     15 
     16-- 
     17 
     18the Feed Me Links staff 
     19 
     20"; 
     21        $headers = get_mail_headers(); 
     22        $to = getEmailAddressForUser( $u ); 
     23 
     24        $success = mail( $to, "Someone has added you as a contact", $body, $headers); 
     25        return $success; 
     26} 
    627 
    728# returns the PATH to the newly created thumbnail 
     
    24092430"; 
    24102431 
    2411                                         $headers .= "From: Feed Me Links <" . getEmailAddressForUser( $commenter ) . ">\n"; 
    2412                                         $headers .= "X-Mailer: feedmelinks-mailer-daemon\n"; 
     2432                                        $headers = get_mail_headers(); 
    24132433                                        $mailSuccess = mail( $to, $subject, $body, $headers); 
    24142434                                        if( $debug ) 
     
    24472467} 
    24482468 
     2469function get_mail_headers() { 
     2470        $headers = ""; 
     2471        $headers .= "From: Feed Me Links <do-not-reply@feedmelinks.com>\n"; 
     2472        $headers .= "X-Mailer: feedmelinks-mailer-daemon\n"; 
     2473        return $headers; 
     2474} 
    24492475function getOwnerForFolder( $argId ) { 
    24502476        if($debug)