[rt-users] BCC Staff members replies

Kevin Falcone falcone at bestpractical.com
Fri Dec 31 10:59:13 EST 2010


On Fri, Dec 31, 2010 at 01:10:12PM +0200, Catalin Constantin wrote:
> Thank you for your reply.
> It works.

You can simplify this a bit, Given a User object from CreatorObj, you
can just call PrincipalObj() on it

-kevin

> Below is the SCRIP update (fixed).
> 
> return 0 unless $self->TransactionObj->Type eq 'Correspond';
> 
> my $PrincipalObj = RT::Principal->new( $self->TransactionObj->CreatorObj );
> $PrincipalObj->Load( $self->TransactionObj->CreatorObj->Id );
> 
> my $GroupObj = RT::Group->new($self->TransactionObj->CreatorObj );
> $GroupObj->LoadUserDefinedGroup( 'Group Name' );
> 
> return $GroupObj->HasMemberRecursively( $PrincipalObj );
> 
> On Fri, Dec 31, 2010 at 3:01 AM, Kevin Falcone
> <falcone at bestpractical.com> wrote:
> > On Fri, Dec 31, 2010 at 12:04:06AM +0200, Catalin Constantin wrote:
> >> I am trying to the following scrip:
> >>
> >> return 0 unless $self->TransactionObj->Type eq 'Correspond';
> >> my $GroupObj = RT::Group->new( $RT::SystemUser );
> >> $GroupObj->LoadUserDefinedGroup( 'Group NAME' );
> >> return $GroupObj->HasMemberRecursively( $self->CurrentUser->PrincipalObj );
> >>
> >> The problem i have is that $self->CurrentUser->Id is always 1, no
> >> matter what Staff members is logged in.
> >> Is this normal behavior ?
> >
> > Yes, that is correct.
> >
> > You missed a key part of my note:
> >
> >> > if the transaction creator is privileged or in a group.
> >
> > You need the creator of the transaction, not the current user
> >
> > -kevin
> >
> >>
> >> On Thu, Dec 30, 2010 at 5:33 AM, Kevin Falcone
> >> <falcone at bestpractical.com> wrote:
> >> >
> >> > On Wed, Dec 29, 2010 at 06:51:15PM +0200, Catalin Constantin wrote:
> >> > >    Hello,
> >> > >    I would like to BCC the replies our staff members send.
> >> > >    Currently we have a Bcc: line to the Correspondence template, but this also sends BCC for the
> >> > >    replies the customers send to a ticket.
> >> > >    Can this be done with a "Custom condition" for the "On Correspond Notify Other Recipients"
> >> > >    Scrip ?
> >> >
> >> > Sounds like you may want to just have your template add Bccs if the
> >> > transaction creator is privileged or in a group.  If you want to write
> >> > a custom condition, you can do that too, same idea
> >
> 
> Best wishes for 2011 !
> 
> -- 
> Catalin Constantin
> Dazoot Software
> http://www.dazoot.eu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20101231/8fc04e5c/attachment.sig>


More information about the rt-users mailing list