0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -05:00

Added toggle for donation email notifications

refs https://github.com/TryGhost/Product/issues/3692
This commit is contained in:
Simon Backx 2023-08-07 14:53:41 +02:00 committed by Simon Backx
parent 66675a1383
commit 97580a3cd8
3 changed files with 126 additions and 97 deletions

View file

@ -221,6 +221,11 @@ export default class UserController extends Controller {
this.user.milestoneNotifications = event.target.checked;
}
@action
toggleDonationNotifications(event) {
this.user.donationNotifications = event.target.checked;
}
@action
toggleMemberEmailAlerts(type, event) {
if (type === 'free-signup') {

View file

@ -43,6 +43,7 @@ export default BaseModel.extend(ValidationEngine, {
paidSubscriptionCanceledNotification: attr(),
mentionNotifications: attr(),
milestoneNotifications: attr(),
donationNotifications: attr(),
ghostPaths: service(),
ajax: service(),
session: service(),

View file

@ -346,6 +346,29 @@
</div>
</div>
{{/if}}
{{#if this.membersUtils.isStripeEnabled}}
{{#if (feature 'tipsAndDonations')}}
<div class="user-setting-toggle">
<div>
<label for="user-email">Tips &amp; donations</label>
<p>Every time you receive a donation.</p>
</div>
<div class="for-switch small">
<label class="switch" for="donation-notifications" data-test-label="donation-notifications">
<input
id="donation-notifications"
type="checkbox"
checked={{this.user.donationNotifications}}
class="gh-input"
{{on "change" this.toggleDonationNotifications}}
data-test-checkbox="donation-notifications"
>
<span class="input-toggle-component"></span>
</label>
</div>
</div>
{{/if}}
{{/if}}
<div class="user-setting-toggle">
<div>
<label for="user-email">Milestones</label>