Great application -- quickly does exactly what I wanted -- notifications sent to Slack when new content is created. I would prefer that the URL alias created by the PathAuto module be used instead of the node/number URL. Also, I would like to be able to customize, through the configuration UI, the message that is sent for each notification type.

Thank you and best regards,

Steve

Comments

parkhillrecords created an issue. See original summary.

siddhant.bhosale’s picture

siddhant.bhosale’s picture

Assigned: Unassigned » siddhant.bhosale
Lal_’s picture

Category: Feature request » Bug report

This seems to be a bug, cause it seems to work on update and delete... Need to work on the module weight while installing

siddhant.bhosale’s picture

I have added the patch that will allow pathauto aliases in the notifications.

siddhant.bhosale’s picture

Status: Active » Needs review
Lal_’s picture

Status: Needs review » Needs work
+++ b/notify_to_slack.module
@@ -41,7 +43,17 @@ function notify_to_slack_node_update(NodeInterface $node) {
+//  $nid = $node->id();
+//  kint($nid);
+//  exit();
+//  kint(\Drupal::service('path.alias_manager')->getAliasByPath('/node/'.$nid));
+//  exit();
...
+//$node->toUrl('canonical', ['absolute' => TRUE])->toString()

@@ -55,9 +67,7 @@ function notify_to_slack_send_notification($node, $state) {
-  $name = \Drupal::currentUser()->getAccountName();
...
+  $message_data = $config->get('node.' . $state . '_message');

@@ -100,3 +110,83 @@ function _notify_to_slack_state_check($state) {
+/**
...
+  if (_notify_to_slack_user_check() && _user_actions_to_notify_check('create')) {

please remove the unwanted codes, Only add the .install and raise it again

siddhant.bhosale’s picture

StatusFileSize
new420 bytes

I have removed the unwanted code. Please find the new patch.

siddhant.bhosale’s picture

Status: Needs work » Needs review

pratik_kamble’s picture

Thanks, @SiddhantBhosale for the patch. Marking this issue as fixed.

pratik_kamble’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.