mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
49b86b466a
refs 6140a98351
This officially decouples the newsletter recipients from the post visibility allowing us to send emails to free members only.
20 lines
711 B
JavaScript
20 lines
711 B
JavaScript
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
|
|
|
export default ApplicationAdapter.extend({
|
|
// posts and pages now include everything by default
|
|
buildIncludeURL(store, modelName, id, snapshot, requestType, query) {
|
|
let url = this.buildURL(modelName, id, snapshot, requestType, query);
|
|
let parsedUrl = new URL(url);
|
|
|
|
if (snapshot && snapshot.adapterOptions && snapshot.adapterOptions.sendEmailWhenPublished) {
|
|
parsedUrl.searchParams.append('email_recipient_filter', snapshot.adapterOptions.sendEmailWhenPublished);
|
|
}
|
|
|
|
return parsedUrl.toString();
|
|
},
|
|
|
|
buildQuery(store, modelName, options) {
|
|
return options;
|
|
}
|
|
});
|