-
Notifications
You must be signed in to change notification settings - Fork 1
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
[IDP-1221] Optionally send external-groups sync-errors notification email #375
Merged
forevermatt
merged 17 commits into
develop
from
feature/IDP-1221-sync-errors-notification-email
Oct 2, 2024
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8dda42a
Add test for sync-error notification emails
forevermatt 41cbac5
Add subject for sync-errors email to Emailer class
forevermatt ced1394
Merge branch 'develop' into feature/IDP-1221-sync-errors-notification…
forevermatt 7a39a94
Merge branch 'develop' into feature/IDP-1221-sync-errors-notification…
forevermatt efb4c85
Enable test and live code to use shared code for processing sync errors
forevermatt f5d9f04
Rename external-group sync error variables/constants, for clarity
forevermatt 1059591
Tweak the subject used for external-group sync error emails
forevermatt 3c533d4
Add `EmailLog::MESSAGE_TYPE_EXT_GROUP_SYNC_ERRORS` for sync-error emails
forevermatt 19ff3a7
Enable the `Emailer` to send to an arbitrary email address
forevermatt dc801b5
Optionally send an external-groups sync-errors email notification
forevermatt 0a142ee
Raise minimum PHP version to 8.0 (and update dependencies)
forevermatt 4703e72
Clarify purpose of Google Sheet ID parameter used for sync-error email
forevermatt 14e31fa
Add line to sync-error email about partial-successes
forevermatt 27a7b68
Document the new errors-email-recipient env. vars (in `local.env.dist`)
forevermatt 8a5af26
Fix PSR-2 formatting issue
forevermatt 8976497
Fix test-safety-net to work for GitHub Actions' tests, too
forevermatt aee1705
Re-add PHP 7.4 compatibility
forevermatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
use yii\helpers\Html as yHtml; | ||
|
||
/** | ||
* @var string $appPrefix | ||
* @var string[] $errors | ||
* @var string $googleSheetUrl | ||
* @var string $emailSignature | ||
* @var string $idpDisplayName | ||
* @var string $idpName | ||
*/ | ||
?> | ||
<p> | ||
The following errors occurred when syncing the <?= yHtml::encode($appPrefix) ?> | ||
external groups to the <?= yHtml::encode($idpDisplayName) ?> IDP: | ||
</p> | ||
<?= yHtml::ul($errors) ?> | ||
|
||
<?php | ||
if (empty($googleSheetUrl)) { | ||
?> | ||
<p> | ||
If any of these seem like simple data problems, you can potentially fix them | ||
by updating the information in the Google Sheet used for this | ||
external-groups sync. | ||
</p> | ||
<?php | ||
} else { | ||
?> | ||
<p> | ||
If any of these seem like simple data problems, you can potentially fix them | ||
by updating the information in the "<?= yHtml::encode($idpName) ?>" tab of | ||
this Google Sheet: <br /> | ||
<?= yHtml::a($googleSheetUrl, $googleSheetUrl) ?> | ||
</p> | ||
<?php | ||
} | ||
?> | ||
|
||
<p> | ||
Other users' external groups may have been synced successfully. | ||
</p> | ||
|
||
<p><i><?= nl2br(yHtml::encode($emailSignature), false) ?></i></p> |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it impossible for
googleSheetUrl
to be empty? It would at least have this much: 'https://docs.google.com/spreadsheets/d/'There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, good catch. I'll try to fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submitted follow-up PR to fix that:
#376