File tree Expand file tree Collapse file tree
resources/assets/js/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,18 +152,23 @@ public function create(Request $request): JsonResponse
152152
153153 $ terms = $ this ->terms ->create ((string ) $ request ->get ('version ' ), $ request ->get ('content ' ), auth ()->user ()->id );
154154
155- $ users = $ this ->users ->allNotifiablePublicUsers ();
156- $ emails = $ users ->pluck ('email ' )->implode (', ' );
157- $ route = route ('login ' );
158- $ subject = trans ('terms.email.subject ' , ['app_name ' => config ('app.name ' )]);
159- $ html = $ this ->mailApiService ->buildTermsAndConditionsTemplate ($ route );
160-
161- $ this ->mailApiService ->sendMail (
162- $ emails ,
163- $ subject ,
164- $ html ,
165- true , // Send as bulk email
166- );
155+ // commented out to avoid sending emails on every terms update
156+ // $users = $this->users->allNotifiablePublicUsers();
157+ // $route = route('login');
158+ // $subject = trans('terms.email.subject', ['app_name' => config('app.name')]);
159+ // $html = $this->mailApiService->buildTermsAndConditionsTemplate($route);
160+
161+ // $users->pluck('email')
162+ // ->chunk(25)
163+ // ->each(function ($emailChunk) use ($subject, $html) {
164+ // $emails = $emailChunk->implode(',');
165+ // $this->mailApiService->sendMail(
166+ // $emails,
167+ // $subject,
168+ // $html,
169+ // true
170+ // );
171+ // });
167172
168173
169174 return TermsResource::make ($ terms )->response ()->setStatusCode (JsonResponse::HTTP_CREATED );
Original file line number Diff line number Diff line change @@ -237,10 +237,15 @@ public function reactivate(User $user)
237237
238238 public function allNotifiablePublicUsers ()
239239 {
240- return $ this ->query ()->whereHas ('roles ' , function ($ query ) {
241- $ query ->where ('all ' , '= ' , 0 );
242- $ query ->doesntHave ('permissions ' ); })->whereHas ('userProfile ' , function ($ query ) {
243- $ query ->where ('notifications_enabled ' , '= ' , 1 );
244- })->get ();
240+ return $ this ->query ()
241+ ->where ('activated ' , true )
242+ ->whereHas ('roles ' , function ($ query ) {
243+ $ query ->where ('all ' , '= ' , 0 )
244+ ->doesntHave ('permissions ' );
245+ })
246+ ->whereHas ('userProfile ' , function ($ query ) {
247+ $ query ->where ('notifications_enabled ' , '= ' , 1 );
248+ })
249+ ->get ();
245250 }
246251}
Original file line number Diff line number Diff line change 3939 <h2 >
4040 {{ $t('landing.footer.subtitle_3') }}
4141 </h2 >
42- <router-link class =" footer-link" :to =" { name: 'terms-service' }" >
43- {{ $t('landing.footer.terms_service') }}
44- </router-link >
42+ <router-link class =" footer-link" :to =" { name: 'legal_terms' }" > {{ $t('register_form.terms_conditions') }}</router-link >
4543 </div >
4644 <div >
4745 <h2 >
You can’t perform that action at this time.
0 commit comments