New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue: Template Variables in Ticket Filter #5283
Conversation
12e52f4
to
ef517df
Compare
@@ -3851,6 +3851,9 @@ static function create($vars, &$errors, $origin, $autorespond=true, | |||
return null; | |||
|
|||
/* -------------------- POST CREATE ------------------------ */ | |||
$vars['ticket'] = $ticket; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use only certain filters with actions like Send Email, etc.
It seemed like the best way to control when we run certain filter actions (before or after ticket creation) was best handled with adding the postCreate variable to the apply functions. I passed it as its own variable rather than sending it through vars because later on in the process, we start using $this->vars instead of just $vars, and it wasn't working out at the end. I'm open to suggestions though if there is a better way to make this work with a function rather than a variable. Also, it didn't seem like there were any other actions we needed to happen postCreate. Can you guys think of any we'd need to wait to run? |
3313e5e
to
aeae758
Compare
aeae758
to
9a58b01
Compare
This commit fixes an issue where you could not use template variables when using the 'Send an Email' filter action. All variables would just display as 'Array'. We needed to pass the Ticket object to FA_SendEmail::apply however, we were running the filters before the Ticket object was created. To fix this, we can add the Ticket object to vars and run the filterTicketData function again after the Ticket is created and only apply the send email filter action if the Ticket object is found.
This commit controls when we run certain types of filters. If we are sending out an email, we want those filter actions to run after the ticket is created in case template variables are used. All other types of filter actions can run before the ticket is created.
9a58b01
to
8a82d1e
Compare
This commit fixes an issue where you could not use template variables when using the 'Send an Email' filter action. All variables would just display as 'Array'.
We needed to pass the Ticket object to FA_SendEmail::apply, however, we were running the filters before the Ticket object was created. To fix this, we can add the Ticket object to vars and run the filterTicketData function again after the Ticket is created and only apply the send email filter action if the Ticket object is found.