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

Not receiving notifications #8

Open
jcsoriano opened this issue Sep 18, 2020 · 2 comments
Open

Not receiving notifications #8

jcsoriano opened this issue Sep 18, 2020 · 2 comments

Comments

@jcsoriano
Copy link

Environment
PHP: 7.4.10
Laravel: 7.28.3

Hi, thank you for the package! I tried a simple use case but my pagerduty account isn't receiving it. I don't see any exceptions being thrown, but I do see via Telescope that the Notification is firing. Am I missing something? I didn't see from the docs that I should add anything in .env, so I went straight to this.

Here is BasicNotification.php

    public function via($notifiable)
    {
        return [PagerDutyChannel::class];
    }

    public function toPagerDuty($notifiable) : PagerDutyMessage
    {
        return PagerDutyMessage::create()
            ->setSummary('Sample Message');
    }

Here is how I ran it:

Notification::route(PagerDutyChannel::class, '[my integration key]')->notify(new BasicNotification);

Here Telescope shows the Notification fired:

image

But I receive nothing in my PagerDuty account:

image

Any pointers to successfully use your package will be much appreciated!

@jcsoriano
Copy link
Author

jcsoriano commented Sep 20, 2020

Was able to debug it; for those who will read this in the future and encounters this, the issue is in the usage of ad-hoc notifications. Change:

Notification::route(PagerDutyChannel::class, '[my integration key]')->notify(new BasicNotification);

to

Notification::route('PagerDuty', '[my integration key]')->notify(new BasicNotification);

It was failing silently on this line of code in PagerDutyChannel.php:

image

To the maintainers of this package, do you think we should add to the documentation how to use it on Ad-hoc notifications? I am open to creating a PR on the readme for this; just let me know.

Thanks!

@atymic
Copy link
Member

atymic commented Jan 14, 2021

Feel free to create a docs PR :)

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

2 participants