Ghost/ghost/admin/app/routes/settings/members-email.js
Sanne de Vries 21b4b15a1c Improved Email newsletter settings page (#2207)
Updated email newsletter settings

- Added toggle to disable email newsletters
- Hides email related UI when email is completely turned off
- Rearranged email newsletter settings
- Added publish-menu preview in 
- Changed default-recipients setting
- Updated publish-menu to show Publish as default action
- Removed the confirmation modal during publishing when no emails are intended to be sent
2022-01-27 12:40:11 +01:00

39 lines
975 B
JavaScript

import AdminRoute from 'ghost-admin/routes/admin';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
export default class MembersEmailRoute extends AdminRoute {
@service notifications;
@service settings;
beforeModel(transition) {
super.beforeModel(...arguments);
if (transition.to.queryParams?.fromAddressUpdate === 'success') {
this.notifications.showAlert(
`Newsletter email address has been updated`,
{type: 'success', key: 'members.settings.from-address.updated'}
);
}
}
model() {
return this.settings.reload();
}
setupController(controller) {
controller.resetEmailAddresses();
}
@action
willTransition(transition) {
return this.controller.leaveRoute(transition);
}
buildRouteInfoMetadata() {
return {
titleToken: 'Settings - Members'
};
}
}