From 33b2bdcd57da4bfc32eb8455c3e6f8604d1cb4dd Mon Sep 17 00:00:00 2001 From: Peter Edmond Date: Sun, 15 Dec 2024 21:58:31 +0000 Subject: [PATCH] Added Scrip2 to send redacted facilitator email --- FacilitatorEmail.txt | 12 +++---- Scrip2.txt | 75 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 Scrip2.txt diff --git a/FacilitatorEmail.txt b/FacilitatorEmail.txt index d35cd30..5275637 100644 --- a/FacilitatorEmail.txt +++ b/FacilitatorEmail.txt @@ -1,14 +1,12 @@ Subject: AutoReply: {$Ticket->Subject} Content-Type: text/html -

A person has expressed interest in the Davis Method.

+

Congratulations! You have received a referral from the Davis Facilitator Directory. You can find the details of the lead by going to https://support.davismethod.com/form?id={$Ticket->id}&email={$Ticket->FirstCustomFieldValue('Facilitator Email')}&uuid={$Ticket->FirstCustomFieldValue('uuid')}.

-

They have provided the following information:

-
-{$Info}
-
- -

If you are interested in this client, then please confirm your interest in this client in the next 48 hours by going to https://support.davismethod.com/form?{$uniqueID}

+

Please accept or reject the lead in the next 48 hours. If we do not hear from you, the referral will be reassigned.

The Davis Team

+ + + diff --git a/Scrip2.txt b/Scrip2.txt new file mode 100644 index 0000000..6536f8e --- /dev/null +++ b/Scrip2.txt @@ -0,0 +1,75 @@ +# On create: +# - Sent email to requestor +# - Check queue, and transfer to new queue if required + +# Custom condition: + +my $txn = $self->TransactionObj; +my $type = $txn->Type; +my $ticket = $self->TicketObj; + +return 0 unless $type eq "Status" || ( $type eq 'Set' && $txn->Field eq 'Status'); +return 0 unless $txn->OldValue eq "new"; +return 0 unless $txn->NewValue eq "Hub Not Assigned"; +# To test by triggering change of status (Condition ^ above!) + +#Only act in test-queue (safety for testing) +return 0 unless $ticket->QueueObj->Name eq "test-queue"; +#Only act on creation +#return 0 unless $txn->Type eq "Create"; + +return 1; + +# Custom action preparation code: +require RT::Action::SendEmail; +use strict; +use vars qw/@ISA/; +@ISA = qw(RT::Action::SendEmail); +$self->SetRecipients(); + +$self->SUPER::Prepare(); +$self->SUPER::Commit(); +sub SetRecipients { +my $self = shift; +my $ticket = $self->TicketObj; +my ( @To, @PseudoTo, @Cc, @Bcc ); +my $arg ='Owner,Requestor,AdminCc,Cc'; +##Requestor +#push @To, $ticket->Requestors->MemberEmailAddresses; +push @To, $ticket->FirstCustomFieldValue('Facilitator Email'); + +my $creator = "Davis Admin"; +@{ $self->{'To'} } = @To; + +} + +1; + +# Custom action commit code: +#Move to Redacted Facilitator email sent. + +my $ticket = $self->TicketObj; +my $facilitator = $ticket->FirstCustomFieldValue('Facilitator Email'); + +if ($ticket->FirstCustomFieldValue('Facilitator Email') eq '') { + return 0; +} + +#if ($ticket->Status() ne "new") { +# return 1; +#} + +#$ticket->Comment(Content => 'Script #22 - sending email to facilitator'); +#$ticket->Comment(Content => 'Status is: '.$self->TicketObj->Status()); + + + +$ticket->Comment(Content => 'AUTO: Email sent. Facilitator is: '.$ticket->FirstCustomFieldValue('Facilitator Email')); + +$ticket->Comment(Content => 'AUTO: Changing status to "Redacted Facilitator Email Sent"'); +my ($status, $msg) = $ticket->SetStatus('Redacted Facilitator Email Sent'); + +return 1; + + +