Implement IMAP email-to-ticket gateway
This commit is contained in:
1 parent
b7e5884457
commit
6f25869345
33 files changed
+5619
-5
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Box\Mod\Mailgateway;
|
||||
|
||||
/** Used only while Support creates a ticket for an imported message. */
|
||||
class NotificationEmailProxy
|
||||
{
|
||||
public function __construct(private object $email, private \Closure $acknowledge) {}
|
||||
|
||||
public function sendTemplate(array $data): mixed
|
||||
{
|
||||
if (($data['code'] ?? '') === 'mod_support_ticket_open') {
|
||||
return ($this->acknowledge)($data);
|
||||
}
|
||||
// The canned reply remains in the ticket. Send the ticket-number
|
||||
// acknowledgement instead of a second automatic canned-reply email.
|
||||
if (($data['code'] ?? '') === 'mod_support_ticket_staff_reply') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->email->sendTemplate($data);
|
||||
}
|
||||
|
||||
public function __call(string $method, array $arguments): mixed
|
||||
{
|
||||
return $this->email->$method(...$arguments);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user