Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically to_json attachments property in chat_postMessage #20

Closed
dblock opened this issue Nov 5, 2015 · 0 comments
Closed

Automatically to_json attachments property in chat_postMessage #20

dblock opened this issue Nov 5, 2015 · 0 comments

Comments

@dblock
Copy link
Collaborator

dblock commented Nov 5, 2015

Posting attachments requires a to_json call on the attachments property. See slackapi/node-slack-sdk#12.

Slack-ruby-client should do it for you.

.chat_postMessage(
  channel: ...,
  text: 'Hello World',
  as_user: true,
  attachments: [
        {
            fallback: "New ticket from Andrea Lee - Ticket #1943: Can't rest my password - https://groove.hq/path/to/ticket/1943",
            pretext: "New ticket from Andrea Lee",
            title: "Ticket #1943: Can't reset my password",
            title_link: "https://groove.hq/path/to/ticket/1943",
            text: "Help! I tried to reset my password but nothing happened!",
            color: "#7CD197"
        }
    ].to_json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant