Added group mailbox functionnality.#407
Added group mailbox functionnality.#407bestkiller92 wants to merge 4 commits intoAlanaktion:masterfrom
Conversation
If a mail is received by the application mailbox from the group mailbox, the ticket will be assigned to the group.
Alanaktion
left a comment
There was a problem hiding this comment.
This seems like a useful feature, I have a few notes and questions before I can merge it.
Also please check the results of the CI checks to ensure your code follows the standards. Only ERROR lines need to be fixed, many warnings are expected.
| @@ -1,4 +1,4 @@ | |||
| SET NAMES utf8mb4; | |||
| SET NAMES utf8; | |||
There was a problem hiding this comment.
The utf8mb4 encoding here is required to correctly support many Unicode characters including Emoji, was there a reason you changed this?
There was a problem hiding this comment.
Sorry, this as been added by git. On my dev environment I have to remove "mb4" to have the db working, but this is not part of my changes.
| `user_id` int(10) unsigned NOT NULL, | ||
| `group_id` int(10) unsigned NOT NULL, | ||
| `manager` tinyint(1) NOT NULL DEFAULT '0', | ||
| `mailbox` tinyint(1) NOT NULL DEFAULT '0', |
There was a problem hiding this comment.
Changes to database schemas need to also have an update file, like the other .sql files in this directory, otherwise the changes won't be applied to existing installations. The config table's value attribute should be updated to match that name, both in this file and at the end of the update script.
app/controller/admin.php
Outdated
|
|
||
| $to_user = new \Model\User; | ||
| $members2 = new \Model\Custom("user_group_user"); | ||
| $to_user->load(array('email = ? AND deleted_date IS NULL', 'contact@interfast-intl.be')); |
There was a problem hiding this comment.
You probably don't want the email address hard-coded here.
There was a problem hiding this comment.
Indeed, I have to review this part, I will come soon with the correct code. I think there is something to change with the $members2 variable.
There was a problem hiding this comment.
Those line should be removed, they were part of a test. I will doublecheck this week and update my code.
cron/checkmail2.php
Outdated
| } | ||
|
|
||
| $from = $header->from[0]->mailbox . "@" . $header->from[0]->host; | ||
| $subject = utf8_decode_email_subject($header->subject); |
There was a problem hiding this comment.
I would recommend using imap_utf8($header->subject) instead to correctly handle the decoding. It will support correctly converting from any encoding like ISO-8859-1, etc.
If a mail is received by the application mailbox from the group mailbox, the ticket will be assigned to the group. Correction made according to Alan's comments.
If a mail is received by the application mailbox from the group mailbox, the ticket will be assigned to the group.