Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99059217
PhabricatorEditorMailEngineExtension.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
Sat, Jan 18, 19:24
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Jan 20, 19:24 (2 d)
Engine
blob
Format
Raw Data
Handle
23691175
Attached To
rPH Phabricator
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
());
}
}
Event Timeline
Log In to Comment