[Bps-public-commit] RT-Extension-ListAllEmailRecipients branch, 4.2-backport, updated. 9964f890e047f018d5694aa0c58bd6a9d4796792

Shawn Moore shawn at bestpractical.com
Fri Mar 10 15:11:13 EST 2017


The branch, 4.2-backport has been updated
       via  9964f890e047f018d5694aa0c58bd6a9d4796792 (commit)
       via  bc3a5b9f71e765253f718223eb1a9da3d6672886 (commit)
      from  2386d72462f4dbe4c011d320be246aa35804533d (commit)

Summary of changes:
 lib/RT/Extension/ListAllEmailRecipients.pm | 26 ++++++++-----------
 patches/add-mailgate-call.diff             | 41 ++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 15 deletions(-)
 create mode 100644 patches/add-mailgate-call.diff

- Log -----------------------------------------------------------------
commit bc3a5b9f71e765253f718223eb1a9da3d6672886
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri Mar 10 19:50:14 2017 +0000

    Notification recipients for email ticket create

diff --git a/lib/RT/Extension/ListAllEmailRecipients.pm b/lib/RT/Extension/ListAllEmailRecipients.pm
index 26015ca..58b968f 100644
--- a/lib/RT/Extension/ListAllEmailRecipients.pm
+++ b/lib/RT/Extension/ListAllEmailRecipients.pm
@@ -134,16 +134,12 @@ sub ProcessScripDryRun {
     if ( $args{'UpdateInterface'} eq 'EmailCreate' ) {
         # load separate ticket obj for dry-run
         my $TicketObj = RT::Ticket->new($args{'Ticket'}->CurrentUser);
-        @dryrun = $TicketObj->DryRun(
-            sub {
-                $TicketObj->Create(
-                    Queue     => $args{'Queue'},
-                    Subject   => $args{'Subject'},
-                    Requestor => $args{'Requestor'},
-                    Cc        => $args{'Cc'},
-                    MIMEObj   => $args{'MIMEObj'},
-                );
-            }
+        @dryrun = $TicketObj->DryRunCreate(
+            Queue     => $args{'Queue'},
+            Subject   => $args{'Subject'},
+            Requestor => $args{'Requestor'},
+            Cc        => $args{'Cc'},
+            MIMEObj   => $args{'MIMEObj'},
         );
     }
     elsif ( $args{'UpdateInterface'} eq 'Email' ){
diff --git a/patches/add-mailgate-call.diff b/patches/add-mailgate-call.diff
new file mode 100644
index 0000000..9edc895
--- /dev/null
+++ b/patches/add-mailgate-call.diff
@@ -0,0 +1,23 @@
+diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
+index ef618e6..8d9eea3 100644
+--- a/lib/RT/Interface/Email.pm
++++ b/lib/RT/Interface/Email.pm
+@@ -1456,6 +1456,18 @@ sub Gateway {
+             );
+         }
+ 
++        if (grep { $_ eq 'RT::Extension::ListAllEmailRecipients' } RT->Config->Get('Plugins')) {
++            RT::Extension::ListAllEmailRecipients::FindNotificationRecipients(
++                Ticket    => $Ticket,
++                Queue     => $SystemQueueObj->Id,
++                Subject   => $NewSubject,
++                Requestor => \@Requestors,
++                Cc        => \@Cc,
++                MIMEObj   => $Message,
++                UpdateInterface => 'EmailCreate',
++            );
++        }
++
+         my ( $id, $Transaction, $ErrStr ) = $Ticket->Create(
+             Queue     => $SystemQueueObj->Id,
+             Subject   => $NewSubject,

commit 9964f890e047f018d5694aa0c58bd6a9d4796792
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri Mar 10 20:09:58 2017 +0000

    Notification recipients for email ticket reply/comment

diff --git a/lib/RT/Extension/ListAllEmailRecipients.pm b/lib/RT/Extension/ListAllEmailRecipients.pm
index 58b968f..6dc8c9d 100644
--- a/lib/RT/Extension/ListAllEmailRecipients.pm
+++ b/lib/RT/Extension/ListAllEmailRecipients.pm
@@ -153,11 +153,11 @@ sub ProcessScripDryRun {
         }
 
         my $action = ucfirst $args{Action};
-        @dryrun = $TicketObj->DryRun(
-            sub {
-                my ( $status, $msg ) = $TicketObj->$action( MIMEObj => $args{Message} );
-            }
-        );
+
+        # DryRun maps "Correspond" to Comment
+        $action = 'Respond' if lc($action) eq 'correspond';
+
+        @dryrun = $TicketObj->DryRun( MIMEObj => $args{Message}, Action => $action );
     }
     elsif ( $args{'id'} and $args{'id'} eq 'new' ){
         return unless $args{'TicketObj'};
diff --git a/patches/add-mailgate-call.diff b/patches/add-mailgate-call.diff
index 9edc895..bddfe6e 100644
--- a/patches/add-mailgate-call.diff
+++ b/patches/add-mailgate-call.diff
@@ -1,5 +1,5 @@
 diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
-index ef618e6..8d9eea3 100644
+index ef618e6..8643a24 100644
 --- a/lib/RT/Interface/Email.pm
 +++ b/lib/RT/Interface/Email.pm
 @@ -1456,6 +1456,18 @@ sub Gateway {
@@ -21,3 +21,21 @@ index ef618e6..8d9eea3 100644
          my ( $id, $Transaction, $ErrStr ) = $Ticket->Create(
              Queue     => $SystemQueueObj->Id,
              Subject   => $NewSubject,
+@@ -1504,6 +1516,17 @@ sub Gateway {
+ 
+         #   If the action is comment, add a comment.
+         if ( $action =~ /^(?:comment|correspond)$/i ) {
++
++            if (grep { $_ eq 'RT::Extension::ListAllEmailRecipients' } RT->Config->Get('Plugins')) {
++                RT::Extension::ListAllEmailRecipients::FindNotificationRecipients(
++                    Ticket      => $Ticket,
++                    Message     => $Message,
++                    Action      => $action,
++                    CurrentUser => $CurrentUser,
++                    UpdateInterface => 'Email',
++                );
++            }
++
+             my $method = ucfirst lc $action;
+             my ( $status, $msg ) = $Ticket->$method( MIMEObj => $Message );
+             unless ($status) {

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list