Closed Bug 284288 Opened 19 years ago Closed 18 years ago

Email Notifications should always include all fields

Categories

(Bugzilla :: Email Notifications, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 70710

People

(Reporter: matthew.newman, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Build Identifier: 

I need to be able to send the long form content to each user in the updated 
email notificiation. Currently, each e-mail sends just what was updated or 
modified for each bug. The long form content contains all the information about 
the bug in the first place, plus all comments and changes. 

Bad Example: Email shows updated bug information.
Good Example: Email shows all long form content per bug.


Reproducible: Always



Expected Results:  
Just sends what is updated, not longform.
OS: Linux → All
Hardware: PC → All
Summary: Must place long form content in email notificiations to users → Email Notifications should always include all fields
Fixed the bug myself. Below is the appropriate addtions of code to the 
following files:

Globals.pl:

sub GetLongDescriptionAsText2 {
    #Edited by Matthew Newman on 3/28/05, newmamj2@juniata.edu
    my ($id, $start, $end) = (@_);
    my $result = "";
    my $result2 = "";
    my $result3 = "";
    my $count = 0;
    my $count2 = 0;
    my ($query) = ("SELECT profiles.login_name, longdescs.bug_when, " .
                   "       longdescs.thetext " .
                   "FROM   longdescs, profiles " .
                   "WHERE  profiles.userid = longdescs.who " .
                   "AND    longdescs.bug_id = $id ");

   my ($query2) = ("SELECT profiles.login_name, longdescs.bug_when, " .
                   "       longdescs.thetext " .
                   "FROM   longdescs, profiles " .
                   "WHERE  profiles.userid = longdescs.who " .
                   "AND    longdescs.bug_id = $id ");

    if ($start && $start =~ /[1-9]/) {
        # If the start is all zeros, then don't do this (because we want to
        # not emit a leading "Additional Comments" line in that case.)
        $query .= "AND longdescs.bug_when > '$start'";
        $query2 .= "AND longdescs.bug_when > '$start'";
        $count = 1;
        $count2 = 1;
    }
    if ($end) {
        $query .= "AND longdescs.bug_when <= '$end'";
        $query2 .= "AND longdescs.bug_when <= '$end'";
    }

    $query .= "ORDER BY longdescs.bug_when DESC";
    $query2 .= "ORDER BY longdescs.bug_when";

    SendSQL($query);
    while (MoreSQLData()) {
        my ($who, $when, $text) = (FetchSQLData());
        #Posts latest comment
        if ($count ==0) {
            $result .= "\n\n---- New Additional Comment From $who".Param
('emailsuffix')."  ".
                time2str("%m-%d-%Y %H:%M", str2time($when)) . " ----\n";
        }
        #Posts older comments
        if ($count) {
            $result .= "\n\n------- Additional Comments From $who".Param
('emailsuffix')."  ".
                time2str("%m-%d-%Y %H:%M", str2time($when)) . " -------\n";
        }

        $result .= $text;
        $count++;
    }


     #Capture identical SQL sequence
       SendSQL($query2);

      #Sends the first comment from bug
        if ($count2 ==0) {
           my ($who, $when, $text) = (FetchSQLData());
           $result2 .= "         Bug Added: ". time2str("%m-%d-%Y %H:%M", 
str2time($when)) . "\n";
                        }

     #Returns string of info to processmail
    return $result2 . $result;
}





Code to add to processmail at line 770:

#Edited from original to allow for long descriptions - MJN 2005
    if ($isnew) {
      $substs{"diffs"} = $head;
    } else {
      $substs{"diffs"} = $head;
    }



    $substs{"summary"} = $values{'short_desc'};
    $substs{"reasonsheader"} = join(" ", @reasons);
    $substs{"reasonsbody"} = $reasonsbody;

    #Catches the first comment and throws it to the globals.pl class
    if ($isnew) {
      $substs{"commentsz"} = GetLongDescriptionAsText($id);
                }

    #Same thing for every other message
     else {
    $substs{"commentsz"} = GetLongDescriptionAsText2($id);





Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Please don't mark bugs fixed unless you fix them in the Bugzilla CVS with a
checkin. :-)

If you'd like to attach your code as a patch and ask for review, we'd very much
appreciate it. You can see details in the Contributor's Guide at
http://www.bugzilla.org/docs/contributor.html
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Whiteboard: DUPE ME
? Dupe?
I'm not seeing a dup anywhere (at least, not one that's unfixed and
severity=enh).  Perhaps you're thinking of Bug 35281. Or Bug 224916.  Neither of
these precisely describes this reporter's (Matt's) request.

Matt, sounds like if you attach the code in the correct format then someone will
confirm the bug.
Whiteboard: DUPE ME → DUPEME

*** This bug has been marked as a duplicate of 70710 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago18 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.