# Slack plugin fails to send notifications for posts containing links

**URL:** https://meta.discourse.org/t/slack-plugin-fails-to-send-notifications-for-posts-containing-links/60686
**Category:** Support
**Tags:** chat-integration
**Created:** [2017年四月9日 15:46 UTC](https://meta.discourse.org/t/slack-plugin-fails-to-send-notifications-for-posts-containing-links/60686 "2017-04-09T15:46:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [2017年四月9日 15:46 UTC](https://meta.discourse.org/t/slack-plugin-fails-to-send-notifications-for-posts-containing-links/60686/1 "2017-04-09T15:46:14Z")

</div>

Using the most recent version of the Slack plugin, a post I created recently never got posted to Slack.

In there error logs, I see this message and backtrace:

```plaintext
Job exception: undefined method `absolute' for DiscourseSlack::Slack:Class
...
/var/www/discourse/plugins/discourse-slack-official/slack_parser.rb:54:in `start_element'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/sax/parser.rb:36:in `parse_with'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/sax/parser.rb:36:in `parse_memory'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/sax/parser.rb:84:in `parse'
/var/www/discourse/plugins/discourse-slack-official/slack_parser.rb:20:in `block in get_excerpt'
/var/www/discourse/plugins/discourse-slack-official/slack_parser.rb:19:in `catch'
/var/www/discourse/plugins/discourse-slack-official/slack_parser.rb:19:in `get_excerpt'
/var/www/discourse/plugins/discourse-slack-official/lib/discourse_slack/slack.rb:18:in `excerpt'
/var/www/discourse/plugins/discourse-slack-official/lib/discourse_slack/slack.rb:93:in `slack_message'
/var/www/discourse/plugins/discourse-slack-official/lib/discourse_slack/slack.rb:176:in `block in notify'
/var/www/discourse/plugins/discourse-slack-official/lib/discourse_slack/slack.rb:170:in `each'
/var/www/discourse/plugins/discourse-slack-official/lib/discourse_slack/slack.rb:170:in `notify'
/var/www/discourse/plugins/discourse-slack-official/app/jobs/regular/notify_slack.rb:4:in `execute'
/var/www/discourse/app/jobs/base.rb:154:in `block (2 levels) in perform'

```

That method is trying to be called here:

> <https://github.com/discourse/discourse-slack-official/blob/7e1432d99a673e28bfb10cc5abf186dfba1f02e8/slack_parser.rb#L54>

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2017年四月9日 16:07 UTC](https://meta.discourse.org/t/slack-plugin-fails-to-send-notifications-for-posts-containing-links/60686/2 "2017-04-09T16:07:57Z")

</div>

thank you @mcwumbly. Yes `absolute` method missing in latest commit. I think it was removed mistakenly. If yes then @tgxworld merge my PR below.

[https://github.com/discourse/discourse-slack-official/pull/33](https://github.com/discourse/discourse-slack-official/pull/33)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2017年四月10日 03:57 UTC](https://meta.discourse.org/t/slack-plugin-fails-to-send-notifications-for-posts-containing-links/60686/3 "2017-04-10T03:57:25Z")

</div>

Fixed in

[https://github.com/discourse/discourse-slack-official/commit/6eaf264df706d98cd7732880c28b233e6c047d36](https://github.com/discourse/discourse-slack-official/commit/6eaf264df706d98cd7732880c28b233e6c047d36)

with test cases added.

@vinothkannans Thanks for looking into this as well. I made some changes to the existing method instead of reusing the previous one. Thank you for your PR!

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2017年四月10日 03:57 UTC](https://meta.discourse.org/t/slack-plugin-fails-to-send-notifications-for-posts-containing-links/60686/4 "2017-04-10T03:57:28Z")

</div>


