-
Notifications
You must be signed in to change notification settings - Fork 106
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
Added group mailbox functionnality. #407
base: master
Are you sure you want to change the base?
Conversation
If a mail is received by the application mailbox from the group mailbox, the ticket will be assigned to the group.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
||
DROP TABLE IF EXISTS `user_group`; | ||
CREATE TABLE `user_group` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Ok, I will do that
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', '[email protected]')); |
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.
You probably don't want the email address hard-coded here.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those line should be removed, they were part of a test. I will doublecheck this week and update my code.
cron/checkmail2.php
Outdated
@@ -127,20 +141,21 @@ | |||
} | |||
|
|||
$from = $header->from[0]->mailbox . "@" . $header->from[0]->host; | |||
$subject = utf8_decode_email_subject($header->subject); |
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.
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.
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.
Indeed it's best
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.