SlackProvider
Requirements
Configuration
{
"token": null,
"defaultChannel": "##general"
}toSlack
public struct function toSlack( notifiable, newSlackMessage ) {
return newSlackMessage()
.to( "##payments" )
.text( "One of your invoices has been paid!" )
.headerBlock( "Invoice Paid" )
.contextBlock( ( block ) => {
block.text( "Customer ###notifiable.getCustomerId()#" );
} )
.sectionBlock( ( block ) => {
block.text( "An invoice has been paid." );
block.field( "*Invoice No:*#chr( 10 )##getInvoiceNumber()#" ).markdown();
block.field( "*Invoice Recipient:*#chr( 10 )##notifiable.getEmail()#" ).markdown();
} )
.dividerBlock()
.sectionBlock( ( block ) => {
block.text( "Congratulations!" );
} );
}routeNotificationForSlack
Last updated
