Commit Graph

6 Commits

Author SHA1 Message Date
Kevin Ansfield
e5c26aac89 Added newsletter dropdown to publish menu
closes https://github.com/TryGhost/Team/issues/1479

- updated post adapter to append `?newsletter_id=xyz` when passed a `newsletterId` adapterOption
- updated editor save task to pass `options.newsletterId` through as `adapterOptions.newsletterId`
- set up `post.newsletter` relationship ready for handling embedded newsletter association from the API
  - explicitly deleted when serializing back to the API as it doesn't yet ignore the attribute
- updated `<GhPublishmenu>` for newsletter support
  - fetches newsletters on first render so they are available in the dropdown
  - sets "default" (first in the ordered list) newsletter as the initially selected newsletter
  - adds newsletter dropdown to draft publish menu
  - passes `newsletterId` option to editor save task when it's set

This is a minimal implementation for testing. Not included:
- correct free/paid member counts based on selected newsletter
- correct member count in confirmation modal
- indication of selected newsletter for scheduled post
2022-04-06 10:22:06 +01:00
Gabriel Csapo
fdc24103cc [chore] runs native classes codemod for app/adapters (#2239)
no issue

* ran native classes codemod for app/adapters
* migrated slug-url mixin to a utility
2022-02-02 16:57:22 +00:00
Kevin Ansfield
0caa539330 Added label and product options for email recipients (#1947)
refs https://github.com/TryGhost/Team/issues/581
requires https://github.com/TryGhost/Ghost/pull/12932

- added segment option and select to default newsletter recipients setting
- updated segment selector to fetch labels/products and show as options
- updated segment selector and count component to call an action when count changes so we can use it in the email confirmation modal
- removed usage and mapping of older `'none'`, `'all'`, `'free'`, and `'paid'` email recipient filter values
2021-05-07 11:58:05 +01:00
Rishabh Garg
49b86b466a Allowed sending newsletter to free members only (#1751)
refs 6140a98351

This officially decouples the newsletter recipients from the post visibility allowing us to send emails to free members only.
2020-11-07 00:24:27 +05:30
Kevin Ansfield
6fe159c8d9 Updated handling of send_email_when_published
refs 5fd2b7fed1

- sends `?send_email_when_published=true` query param when scheduling/publishing a post with the toggle turned on
  - adds support to the posts adapter for handling the `adapterOptions` option
  - updates the editor `save` task to pass through the required adapter option when a post is being published or scheduled with the toggle checked
- moves state for the email toggle into the publish menu so that we don't try to toggle the model attribute which should only be fetched from the API
- prevent `post.send_email_when_published` being sent to the API via the serializer as it's now a read-only attribute
2019-11-14 17:33:35 +00:00
Kevin Ansfield
a0a0c50ff5 Removed use of ?include=tags,authors,authors.roles query param on post/page requests
no issue
- Admin API v2 now includes tags and authors by default
2019-02-25 21:55:55 +07:00