Skip to content

kajdun/notify_matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

notify_matrix.class.php

PHP class for sending messages to Slack-compatible webhooks for Matrix. Slack-compatible webhooks

Usage

$options = array("format" => "html", 
		 "displayname" => "SomeOne", 
		 "text" => "Have a wonderful day!",
		 "webhookurl" => "https://example.com/api/v1/matrix/hook/123456");

try{
	$notifier = new notify_matrix($options);
	$notifier->send();
} catch (Exception $e) {
	echo $e->getMessage();
}

or

try{
	$notifier = new notify_matrix();
	$notifier->setText("some Text")
	 	 ->setFormat("plain")
		 ->setDisplayName("Some Name")
		 ->setWebhookUrl("https://URL_TO_WEBHOOK")
		 ->send();

} catch (Exception $e) {
	echo $e->getMessage();
}

About

PHP class for sending messages to Slack-compatible webhooks for Matrix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages