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

Added Notification to routeNotificationFor method #49

Conversation

SebastiaanKloos
Copy link
Contributor

Added the Notification class to the routeNotificationFor method. I need to get the notification so I can return the webhook url based on the type of notification like so:

public function routeNotificationForWebhook($notification)
{
    if ($notification instanceof IssueStatusUpdatedNotification) {
        return $this->issue_custom_webhook;
    }

    return $this->custom_webhook;
}

It's the same as how it works with the Slack channel.

Thanks in advance for your time!

@V35CH
Copy link

V35CH commented Feb 6, 2023

Will this PR be merged in the feature?
I need the possibility to set the url based on the notification and not on the notifiable.

@ricsands2801
Copy link

+1 for this

@freekmurze freekmurze merged commit 8a53aaf into laravel-notification-channels:master Oct 26, 2023
10 of 12 checks passed
@freekmurze
Copy link
Member

Because...

  • this change seems correct
  • a lot of people seem to want it
  • we need it as well for a project
  • this project seems not actively maintained

... I've decided to step in merge this and tag a release that contains these changes.

@SebastiaanKloos
Copy link
Contributor Author

Thank you @freekmurze. Really appreciate it 🙏

@ricsands2801
Copy link

Thanks @freekmurze!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants