Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F543291
PhabricatorEditorMailEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorEditorMailEngineExtension.php
View Options
<?php
final
class
PhabricatorEditorMailEngineExtension
extends
PhabricatorMailEngineExtension
{
const
EXTENSIONKEY
=
'editor'
;
public
function
supportsObject
(
$object
)
{
return
true
;
}
public
function
newMailStampTemplates
(
$object
)
{
$templates
=
array
();
$templates
[]
=
id
(
new
PhabricatorPHIDMailStamp
())
->
setKey
(
'actor'
)
->
setLabel
(
pht
(
'Acting User'
));
$templates
[]
=
id
(
new
PhabricatorStringMailStamp
())
->
setKey
(
'via'
)
->
setLabel
(
pht
(
'Via Content Source'
));
$templates
[]
=
id
(
new
PhabricatorBoolMailStamp
())
->
setKey
(
'silent'
)
->
setLabel
(
pht
(
'Silent Edit'
));
$templates
[]
=
id
(
new
PhabricatorBoolMailStamp
())
->
setKey
(
'encrypted'
)
->
setLabel
(
pht
(
'Encryption Required'
));
$templates
[]
=
id
(
new
PhabricatorBoolMailStamp
())
->
setKey
(
'new'
)
->
setLabel
(
pht
(
'New Object'
));
$templates
[]
=
id
(
new
PhabricatorPHIDMailStamp
())
->
setKey
(
'mention'
)
->
setLabel
(
pht
(
'Mentioned User'
));
$templates
[]
=
id
(
new
PhabricatorStringMailStamp
())
->
setKey
(
'herald'
)
->
setLabel
(
pht
(
'Herald Rule'
));
$templates
[]
=
id
(
new
PhabricatorPHIDMailStamp
())
->
setKey
(
'removed'
)
->
setLabel
(
pht
(
'Recipient Removed'
));
return
$templates
;
}
public
function
newMailStamps
(
$object
,
array
$xactions
)
{
$editor
=
$this
->
getEditor
();
$viewer
=
$this
->
getViewer
();
$this
->
getMailStamp
(
'actor'
)
->
setValue
(
$editor
->
getActingAsPHID
());
$content_source
=
$editor
->
getContentSource
();
$this
->
getMailStamp
(
'via'
)
->
setValue
(
$content_source
->
getSourceTypeConstant
());
$this
->
getMailStamp
(
'silent'
)
->
setValue
(
$editor
->
getIsSilent
());
$this
->
getMailStamp
(
'encrypted'
)
->
setValue
(
$editor
->
getMustEncrypt
());
$this
->
getMailStamp
(
'new'
)
->
setValue
(
$editor
->
getIsNewObject
());
$mentioned_phids
=
$editor
->
getMentionedPHIDs
();
$this
->
getMailStamp
(
'mention'
)
->
setValue
(
$mentioned_phids
);
$this
->
getMailStamp
(
'herald'
)
->
setValue
(
$editor
->
getHeraldRuleMonograms
());
$this
->
getMailStamp
(
'removed'
)
->
setValue
(
$editor
->
getRemovedRecipientPHIDs
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 11:11 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
118301
Default Alt Text
PhabricatorEditorMailEngineExtension.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment