Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bestkiller92
Copy link

If a mail is received by the application mailbox from the group mailbox, the ticket will be assigned to the group.

If a mail is received by the application mailbox from the group mailbox, the ticket will be assigned to the group.
Copy link
Owner

@Alanaktion Alanaktion left a 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;
Copy link
Owner

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?

Copy link
Author

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',
Copy link
Owner

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.

Copy link
Author

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


$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'));
Copy link
Owner

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.

Copy link
Author

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.

Copy link
Author

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.

@@ -127,20 +141,21 @@
}

$from = $header->from[0]->mailbox . "@" . $header->from[0]->host;
$subject = utf8_decode_email_subject($header->subject);
Copy link
Owner

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it's best

Developement added 2 commits April 20, 2022 11:13
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants