// handlers/StockRebalancing.cfc
component {
property name="megaphone" inject="NotificationService@megaphone";
function create( event, rc, prc ) {
// ...
var notification = getInstance( "StockRebalancingCompleteNotification" )
notification.setStockSymbol( "APPL" );
notification.setCompletionTimestamp( now() );
megaphone.notify( auth().user(), notification );
// ...
}
}
// handlers/StockRebalancing.cfc
component {
property name="megaphone" inject="NotificationService@megaphone";
function create( event, rc, prc ) {
// ...
megaphone.notify(
auth().user(),
"StockRebalancingCompleteNotification",
{ "stockSymbol": "APPL", "completionTimestamp": now() }
);
// ...
}
}
component name="User" delegates="SendsNotifications@megaphone" accessors="true" {
property name="id";
public string function getNotifiableId() {
return getId();
}
public string function getNotifiableType() {
return "User";
}
}
// handlers/StockRebalancing.cfc
component {
property name="megaphone" inject="NotificationService@megaphone";
function create( event, rc, prc ) {
// ...
auth().user().notify(
"StockRebalancingCompleteNotification",
{ "stockSymbol": "APPL", "completionTimestamp": now() }
);
// ...
}
}