Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -208,6 +208,16 @@ class _Support
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
}
|
||||
|
||||
foreach ( $email->cc as $to )
|
||||
{
|
||||
try
|
||||
{
|
||||
return \IPS\nexus\Support\Department::load( $to, 'dpt_email' );
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -336,6 +346,32 @@ class _Support
|
||||
$request->title = $email->subject;
|
||||
$request->member = (int) $member->member_id;
|
||||
$request->email = $email->from;
|
||||
|
||||
/* Figure out who to notify for replies */
|
||||
$notify = array();
|
||||
foreach( $email->to as $to )
|
||||
{
|
||||
if ( $to !== $department->email )
|
||||
{
|
||||
$notify[] = array( 'type' => 'e', 'value' => $to );
|
||||
}
|
||||
}
|
||||
foreach( $email->cc as $cc )
|
||||
{
|
||||
if ( $cc !== $department->email )
|
||||
{
|
||||
$notify[] = array( 'type' => 'e', 'value' => $cc );
|
||||
}
|
||||
}
|
||||
foreach( ( $email->bcc ?: array() ) as $cc )
|
||||
{
|
||||
if ( $cc !== $department->email )
|
||||
{
|
||||
$notify[] = array( 'type' => 'e', 'value' => $cc, 'bcc' => 1 );
|
||||
}
|
||||
}
|
||||
|
||||
$request->notify = $notify;
|
||||
$request->save();
|
||||
|
||||
/* Create the reply */
|
||||
@@ -356,7 +392,7 @@ class _Support
|
||||
$fromName = \IPS\Settings::i()->nexus_sout_from;
|
||||
break;
|
||||
}
|
||||
$confirmationEmail->send( $member->member_id ? $member : $email->from, array(), array(), $request->department->email, $fromName );
|
||||
$confirmationEmail->send( $member->member_id ? $member : $email->from, array(), array(), $request->department->email, $fromName, array( 'Message-Id' => "<IPS-0-SR{$request->id}.{$request->email_key}-{$request->department->email}>" ) );
|
||||
}
|
||||
|
||||
/* Return */
|
||||
@@ -426,7 +462,7 @@ class _Support
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( preg_match( '/From:.+?(\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b)/i', $email->quote, $_matches ) )
|
||||
if ( preg_match( '/From:.+?(\b[A-Z0-9._%+-\']+@[A-Z0-9.-]+\.[A-Z]{2,9}\b)/i', $email->quote, $_matches ) )
|
||||
{
|
||||
$originallyFrom = $_matches[1];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user