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

3298: Report Notification Subscription #164

Merged
merged 93 commits into from
Oct 1, 2024

Conversation

jeppekroghitk
Copy link
Contributor

@jeppekroghitk jeppekroghitk commented Sep 11, 2024

Link to ticket

2398

Description

This PR introduces a new Subscription feature that enables users to opt into specific reports on a monthly or quarterly basis. Subscribed users will then receive an email containing the chosen report which covers the specified period for the relevant project.

Screenshot of the result

N/A

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

@jeppekroghitk jeppekroghitk requested a review from tuj October 1, 2024 08:59
@tuj tuj added the enhancement New feature or request label Oct 1, 2024
}
break;
default:
return new JsonResponse(['success' => false], 200);
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 you should throw an exception here instead.
BadRequestHttpException.
Then you do not have to send success => true in the responses and it makes it clear that something unsupported has been requested

$subscriptions = $this->subscriptionRepository->findByCustom($userEmail, $content);
$frequencies = $this->getFrequencies($subscriptions);

return new JsonResponse(['success' => true, 'action' => 'unsubscribed', 'frequencies' => $frequencies], 200);
Copy link
Contributor

Choose a reason for hiding this comment

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

response code 200 already signifies success.

{% set number_of_columns = 11 %}

{{ form_start(form) }}
<div class="form-default">
Copy link
Contributor

Choose a reason for hiding this comment

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

This block should be indented 1 tab.

@jeppekroghitk jeppekroghitk requested a review from tuj October 1, 2024 11:35
@jeppekroghitk jeppekroghitk merged commit 9c82081 into develop Oct 1, 2024
9 checks passed
@jeppekroghitk jeppekroghitk deleted the feature/2398-report-notification-subscription branch October 1, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants