Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can either send row messages without styling or you make use of the slack attachment options. The module does the hard work for you and all attachment options from slack are supported.

To add attachments, you need to add some values to your message. See here an example for a message:

Code Block
languagephp
<?php
// define attachment message
$message = "%color%: #36a64f
%pretext% Optional text that appears above the attachment block
%text% Lorem Ipsum la lorem
%author_name% Bobby Tables
%author_link% http://flickr.com/bobby/
%author_icon% http://flickr.com/icons/bobby.jpg
%title% Slack API Documentation
%title_link% https://api.slack.com/";

// send the message:
slackforwhmcs_putMessageIntoQueue ($message, '#whmcs@Custom Notification')

...


It is even possible to add "fields" into the attachment.
For adding fields, you use the following code:

Code Block
languagephp
%FIELD1_NAME% Priority
%FIELD1_VAL% High
%FIELD2_NAME% Customer
%FIELD2_VAL% Hello World

...