Skip to content

Commit

Permalink
Merge pull request #7 from avelis/master
Browse files Browse the repository at this point in the history
Addition of docs exampling Attachments usage.
  • Loading branch information
lamby committed Sep 17, 2015
2 parents bb8d85f + 8b317b0 commit c447750
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions django_slack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,35 @@
* **icon_url** -- URL to an image to use as the icon for this message. (eg. `http://lorempixel.com/48/48`)
* **icon_emoji** -- Emoji to use as the icon for this message (eg. `:chart_with_upwards_trend:`). Overrides `icon_url`.
Richly-formatted messages
--------------------------
You can send any number of richly-formatted messages
as attachments with a given Slack message.
To send a message with an attachment.
#. Assemble your attachments as follows::
attachments = [
{
'title': "Richly-formatted message title',
'text': 'Richly-formatted message body.',
},
]
#. Pass in your attachments to `slack_message` as an optional argument::
from django_slack import slack_message
slack_message('path/to/my_message.slack', {
'foo': Foo.objects.get(pk=17),
}, attachments)
You can assemble and send any number of message objects
within the `attachments` list. For more information
on all available formatting options, please visit the
`Slack API Attachments Docs <https://api.slack.com/docs/attachments>`_
Configuration
-------------
Expand Down

0 comments on commit c447750

Please sign in to comment.