Plugin Directory

Changeset 359554


Ignore:
Timestamp:
03/13/2011 07:11:42 PM (15 years ago)
Author:
tkriplean
Message:

email notifications

Location:
reflect/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • reflect/trunk/php/controllers/bullets_api.php

    r344643 r359554  
    181181                    'comment_id' => (int)$comment_id,
    182182                    'bullet_id' => (int)$bullet_id,
    183                 );
    184                            
    185                 $wpdb->insert( $wpdb->prefix . 'reflect_bullet_current', $params );             
    186             }
    187            
     183                );             
     184                           
     185                    $wpdb->insert( $wpdb->prefix . 'reflect_bullet_current', $params );             
     186   
     187                $comment = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "comments WHERE comment_id = $comment_id");
     188                $post = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "posts WHERE id = $comment->comment_post_ID");
     189                $post_title = $post->post_title;
     190                $link = $post->guid;
     191                $comment_author = $comment->comment_author;
     192                   
     193                    try {
     194                    $subject = "$user summarized a comment you wrote in \"$post_title\"";           
     195                    $message = "Hi $comment_author,\n\n$user believes that you made the following point:\n\n\"$bullet_text\"\n\nTo verify whether this is accurate or not, please visit $link and login.\n\nThanks!";
     196                        mail($comment->comment_author_email, $subject, $message);   
     197                    } catch (Exception $e) {}
     198              }
    188199            return json_encode(array("insert_id"=>$bullet_id, "u"=>$user, "rev_id" => $bullet_rev));
    189200        }
     
    239250            //anons can't delete, unless its their own
    240251            //no-one can post summaries of their own comments
    241 
    242             /*if($current_user->user_level>=8) {
    243              // administrator
    244             } else if($current_user->user_level>=3) {
    245              // editor
    246             } else if($current_user->user_level==2) {
    247              // author
    248             } else if($current_user->user_level==1) {
    249              // contributor
    250             } else if($current_user->user_level==0) {
    251              // subscriber
    252             }*/
    253252           
    254253            /*
  • reflect/trunk/readme.txt

    r356226 r359554  
    6464* Very minor tweaking to make sentence parsing better and proper rendering of escaped text.
    6565
     66= 0.1.6 =
     67* Added email notifications that are sent to a commenter when someone summarizes their comment.
     68
    6669== Upgrade Notice ==
    6770
     
    7477= 0.1.5 =
    7578* Very minor tweaking to make sentence parsing better and proper rendering of escaped text.
     79
     80= 0.1.6 =
     81* Added email notifications that are sent to a commenter when someone summarizes their comment.
  • reflect/trunk/reflect.php

    r356219 r359554  
    44Plugin URI: http://wordpress.org/extend/plugins/reflect/
    55Description: Crowdsourced comment summarization. Helps people listen. Helps everyone find the useful points.
    6 Version: 0.1.5
     6Version: 0.1.6
    77Author: Travis Kriplean
    88Author URI: http://www.cs.washington.edu/homes/travis/
Note: See TracChangeset for help on using the changeset viewer.