This repository has been archived by the owner on Nov 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
1,215 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,14 +58,15 @@ sub notify_cycle { | |
$c->d->db->txn_do(sub { | ||
my $users_id = $_->get_column('users_id'); | ||
my $user = $c->d->rs('User')->find($users_id); | ||
if ($user->data && $user->data->{email}) { | ||
if ($user->email && $user->email_verified) { | ||
$c->d->as($user,sub { | ||
$c->stash->{unsent_notifications_results} = [$user->unsent_notifications_cycle($cycle)->all]; | ||
$c->stash->{unsent_notifications_count} = scalar @{$c->stash->{unsent_notifications_results}}; | ||
unless ($skip_notify) { | ||
try { | ||
$c->d->postman->template_mail( | ||
$user->data->{email}, | ||
$user->email_verified, | ||
$user->email, | ||
'"DuckDuckGo Community Envoy" <[email protected]>', | ||
'[DuckDuckGo Community] '.$c->stash->{unsent_notifications_count}.' new notifications for you', | ||
'notifications', | ||
|
@@ -75,8 +76,9 @@ sub notify_cycle { | |
catch { | ||
try { | ||
$c->d->errorlog("Mailing notifications to " . | ||
$user->data->{email} . " failed, mailing " . $c->d->config->error_email); | ||
$user->email . " failed, mailing " . $c->d->config->error_email); | ||
$c->d->postman->mail( | ||
1, | ||
$c->d->config->error_email, | ||
'"DuckDuckGo Community Envoy" <[email protected]>', | ||
'[DuckDuckGo Community] ERROR ON ENVOY', | ||
|
@@ -86,7 +88,7 @@ sub notify_cycle { | |
catch { | ||
$c->d->errorlog("Failed to mail error report about mailing " . | ||
$c->stash->{unsent_notifications_count} . " notifications to " . | ||
$user->data->{email}); | ||
$user->email); | ||
}; | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,8 @@ sub upload :Chained('logged_in') :Args(0) { | |
$c->stash->{duckpan_release}->version; | ||
} | ||
$c->d->postman->template_mail( | ||
$c->user->data->{email}, | ||
1, | ||
$c->user->email, | ||
'"DuckPAN Indexer" <[email protected]>', | ||
'[DuckPAN] '.$c->stash->{subject}, | ||
'duckpan', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,6 +172,7 @@ sub step :Chained('feedback') :PathPart('') :Args(1) { | |
|
||
$c->stash->{c} = $c; | ||
$c->d->postman->template_mail( | ||
1, | ||
$c->d->config->feedback_email, | ||
'"DuckDuckGo Community" <[email protected]>', | ||
'[DDG Feedback '.$c->stash->{feedback_name}.'] '.$data{'1'}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.