Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92656296
ManiphestCreateMailReceiver.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 22, 11:11
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 11:11 (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
22479466
Attached To
rPH Phabricator
ManiphestCreateMailReceiver.php
View Options
<?php
final
class
ManiphestCreateMailReceiver
extends
PhabricatorMailReceiver
{
public
function
isEnabled
()
{
return
PhabricatorApplication
::
isClassInstalled
(
'PhabricatorManiphestApplication'
);
}
public
function
canAcceptMail
(
PhabricatorMetaMTAReceivedMail
$mail
)
{
$maniphest_app
=
new
PhabricatorManiphestApplication
();
return
$this
->
canAcceptApplicationMail
(
$maniphest_app
,
$mail
);
}
protected
function
processReceivedMail
(
PhabricatorMetaMTAReceivedMail
$mail
,
PhabricatorUser
$sender
)
{
$task
=
ManiphestTask
::
initializeNewTask
(
$sender
);
$task
->
setOriginalEmailSource
(
$mail
->
getHeader
(
'From'
));
$handler
=
new
ManiphestReplyHandler
();
$handler
->
setMailReceiver
(
$task
);
$handler
->
setActor
(
$sender
);
$handler
->
setExcludeMailRecipientPHIDs
(
$mail
->
loadExcludeMailRecipientPHIDs
());
if
(
$this
->
getApplicationEmail
())
{
$handler
->
setApplicationEmail
(
$this
->
getApplicationEmail
());
}
$handler
->
processEmail
(
$mail
);
$mail
->
setRelatedPHID
(
$task
->
getPHID
());
}
}
Event Timeline
Log In to Comment