#2705 - Allow emails to support ticket email integration from emails not associated with a member
| Identifier | #2705 |
|---|---|
| Issue type | Trivial issue (does not break functionality) |
| Title | Allow emails to support ticket email integration from emails not associated with a member |
| Status | Closed (duplicate) |
| Handling member | Chris Graham |
| Addon | tickets |
| Description | I think that there should at least be a configurable option to make the support tickets email integration allow creation of support tickets from emails not associated with a registered member. That way, guests can send emails to the configured support ticket email for issues such as website downtime, problems with registration or logging in, etc.
Doing this is very simple. Modify tickets_email_integration.php in sources. In the ticket_incoming_message function, line 526 in the original sources php file, within the following: if (is_null($member_id)) { if (is_null($existing_ticket)) { change "return;" to "$member_id = $GLOBALS['FORUM_DRIVER']->get_guest_id();" . This will cause the email integration system to, instead of terminating, creating a support ticket as a guest. It will still email out to the member via. ticket_email_cannot_bind function that their email is not an email of a known member (you may wish to modify the function name as well as the text in the template if you make this core, removing the part saying to email from an email address of a registered user). |
| Steps to reproduce | |
| Related to | #2810 - Allow guest ticket submission via. email of ticket email integration |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
diff --git a/lang/EN/tickets.ini b/lang/EN/tickets.ini
index dd07f80..4abdf8c 100755
--- a/lang/EN/tickets.ini
+++ b/lang/EN/tickets.ini
@@ -69,7 +69,7 @@ TICKET_SIMPLE_MAIL_new_regexp=Thank you for your message. (A|An) ".*" support ti
TICKET_SIMPLE_MAIL_reply=A reply to your support ticket on {1} has been made. You can reply from the link below (and access any attachments there may be):\n[url="{3}"]{3}[/url]\n\nYou may also reply to this e-mail directly if you prefer.\n\n---------\n\n
TICKET_SIMPLE_MAIL_reply_regexp=A reply to your support ticket on .* has been made\. You can reply from the link below \(and access any attachments there may be\):\n.*\n+You may also reply to this e-mail directly if you prefer\.\n\n---------\n\n
TICKET_CANNOT_BIND_SUBJECT=Re: {1}
-TICKET_CANNOT_BIND_MAIL=Sorry, we did not recognise the e-mail address {2}: we did not know what account to save a support ticket under.\n\nPlease re-send your message from your account's e-mail address, or include your account username in the subject line in square brackets. For example:\n {3} [Example]\n\n----\n\n{1}
+TICKET_CANNOT_BIND_MAIL=Sorry, we did not recognise the e-mail address {2}: we did not know what account to check support ticket access with.\n\nPlease re-send your message from your account's e-mail address, or include your account username in the subject line in square brackets. For example:\n {3} [Example]\n\n----\n\n{1}
SUPPORT_TICKETS_MAIL=Support ticket e-mail integration
TICKET_MAIL_ON=Enable e-mail integration
CONFIG_OPTION_ticket_mail_on=Whether to send out ticket reply e-mails in simple e-mails (rather than notifications), and to integrate an inbox with the ticket system. The PHP IMAP extension is required, a local SMTP server must be running, and the software scheduler must be running (CRON).
diff --git a/sources/tickets_email_integration.php b/sources/tickets_email_integration.php
index 3c3003b..2e9d61e 100644
--- a/sources/tickets_email_integration.php
+++ b/sources/tickets_email_integration.php
@@ -521,9 +521,13 @@ function ticket_incoming_message($from_email, $subject, $body, $attachments)
$member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_email_address($from_email);
if (is_null($member_id)) {
if (is_null($existing_ticket)) {
- // E-mail back, saying user not found
- ticket_email_cannot_bind($subject, $body, $from_email, $from_email_orig);
- return;
+ if ($existing_ticket !== null) {
+ // E-mail back, saying user not found
+ ticket_email_cannot_bind($subject, $body, $from_email, $from_email_orig);
+ return;
+ }
+
+ $member_id = $GLOBALS['FORUM_DRIVER']->get_guest_id();
} else {
$_temp = explode('_', $existing_ticket);
$member_id = intval($_temp[0]);
Complexities:
1) A big part of this is permissions. We need to check the user has access to reply to an existing ticket, because allowing third parties in looks like a scary security hole to anyone using tickets.
2) We need to include the email address of the user in the ticket like we do for normal guest tickets. That would therefore require further changes.