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

Notifications #2295

Merged
merged 27 commits into from
Jan 4, 2017
Merged

Notifications #2295

merged 27 commits into from
Jan 4, 2017

Conversation

jbrooksuk
Copy link
Member

@jbrooksuk jbrooksuk commented Jan 3, 2017

Closes #2107, closes #1023


We're now using Laravel's Notification system, which allows us to work with Mail, Slack and Nexmo natively. Because of this, I've dropped our custom email template & views, switching to the easier template.

As a bonus, the email template is now themed based on the customisation settings.

Before this can be merged, we need a UI for setting up notifications. Also, @joecohens I don't think that unsubscribing is working?

@jbrooksuk jbrooksuk added this to the V2.4.0 milestone Jan 3, 2017
@jbrooksuk jbrooksuk changed the title [WIP] New notifications [WIP] Notifications Jan 3, 2017
@jbrooksuk jbrooksuk changed the title [WIP] Notifications Notifications Jan 4, 2017
@jbrooksuk
Copy link
Member Author

This is ready to be merged. Although we're adding SMS and Slack, we're not actually going to add a UX setting this up until we've implemented the new design.

If you want, you can go into the subscribers table and manually add the info.

@jbrooksuk
Copy link
Member Author

Just need to fix tests.

->get()
->reject(function ($subscriber) use ($notified) {
return in_array($subscriber->id, $notified);
})->map(function ($subscriber) use ($incident) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use each instead of map here

// First notify all global subscribers.
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();

$globalSubscribers->map(function ($subscriber) use ($update) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

->get()
->reject(function ($subscriber) use ($notified) {
return in_array($subscriber->id, $notified);
})->map(function ($subscriber) use ($incident) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:trollface:

@jbrooksuk
Copy link
Member Author

Done! Tests are failing but I'm sure they're unrelated.

@jbrooksuk jbrooksuk merged commit 8b92704 into 2.4 Jan 4, 2017
@jbrooksuk jbrooksuk deleted the new-notifications branch January 4, 2017 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for notifications External API support (Maintenance & Incidents)
2 participants