no-issue
Handling Stripe Checkout webhooks was failing to send emails to customers
because of a faulty reference. This updates the Webhook Controller to fix
that.
refs https://github.com/TryGhost/Team/issues/1252
In order to ensure that archived Tiers are not selected to be shown in
Portal, both after they archived, and after they've been un-archived -
we need to persist this information to storage. This is currently done
via the `portal_products` setting.
The reasoning behind this is so that un-archiving a Tier doesn't modify
Portal settings without the user being aware.
refs https://github.com/TryGhost/Team/issues/1252
Although Archived Tiers cannot be signed up to via Stripe, we also need
to stop them from being assigned through a complementary subscription.
refs https://github.com/TryGhost/Team/issues/1277
- Enabled the `filter` attribute on the route.
- The events are now filtered in-memory instead of in the database.
- This fixes a wrong logic where the API user would have to know the internal event structure.
refs https://github.com/TryGhost/Team/issues/1252
This allows us to archive and unarchive tiers, but does not implement
any of the background behaviour like modifying portal settings. Or
disabling archived tiers from being used.
The two packages now allow the `active` flag to be passed, and will
update that in the database.
no-issue
We were missing default parameters for webhook creation which cause an
error to throw if we attempted to read from them. This bumps the members
& stripe packages to add default params.
refs https://github.com/TryGhost/Team/issues/1277
- The new events types are: `email_delivered_event`, `email_opened_event` and `email_failed_event`.
- This makes existing data accessible to the admin dashboard
refs https://github.com/TryGhost/Team/issues/1257
Offer Redemptions were being overcounted due to the way we were updating
Stripe configuration for the Members service. We would create a new
instance of the members-api, which would have event handlers for
creating Offer Redemptions - by creating a new instance each time Stripe
config changed, we would overcount them.
Here we've pulled out Stripe related logic into the Stripe service, and
updated it internally - rather than creating a new instance. This means
that we've been able to remove all of the logic for re-instantiating the
members-api.
- Bumped members-api & stripe-service
- Removed reinstantiation of members-api
- Used stripe service to execute migrations
- Updated Stripe Service to handle webhooks & migrations
- Used webhook controller from stripe service
- Used disconnect method from stripe service
- Removed unused stripe dependency
- Removed Stripe webhook config from members-api
refs https://github.com/TryGhost/Toolbox/issues/175
- we're going to be making some changes in v5 wrt supported databases
- we needed a way of detecting the difference between MySQL 5 + 8,
MariaDB etc
- I've created `@tryghost/database-info`, which is a small wrapper
around `knex`, which returns this information
- this commit:
- adds the library to Ghost
- initializes the DB info library upon boot
- updates the Admin API /config/ endpoint and UpdateCheck to return
the new string - `mysql5`, `mysql8` etc
refs https://github.com/TryGhost/Team/issues/1037
- updates `members-api` to handle new free product and `type` column
- updates `members-importer` to handle default product usage as we have both free and paid default products now
refs TryGhost/Team#1242
refs TryGhost/Team#1266
- Both inline and dynamic partials haven't been supported since gscan v4.
- You can now use [inline partials](https://handlebarsjs.com/guide/partials.html#inline-partials) in themes.
- One limitation is that the inline partials aren't available in the execution of other partials.
- You can now use [dynamic partials](https://handlebarsjs.com/guide/partials.html#dynamic-partials) in themes.
- When using dynamic partials, you can only use them as a partial block so that there is a fallback.
- Dynamic partial defined inline like `{{> (dynamicPartial) }}` are considered invalid by gscan to make sure a fallback is present.
no-issue
Due to a bug in the members-csv package we were losing information about
the subscribed_to_emails flag and effectively ignoring it, resulting in
all members beign imported with the default value of true.
refs https://github.com/TryGhost/Team/issues/1257
refs https://github.com/TryGhost/Team/issues/1261
Certain event listens are being added twice due to the way we "reload"
the MembersAPI which can cause duplicate counts of Offer Redemptions.
Rather than creating multiple instances of the MembersAPI we're moving
toward being able to reload the config in place or passing getters for
the config which will allows us to use the MembersAPI as a singleton,
and remove any bugs which come from creating multiple instances.
This also fixes a bug with the allowSelfSignup config not refreshing when
the portal_plans setting was changed.
no-issue
Due to a bug in the members-csv package we were losing information about
the subscribed_to_emails flag and effectively ignoring it, resulting in
all members beign imported with the default value of true.
refs https://github.com/TryGhost/Team/issues/1257
refs https://github.com/TryGhost/Team/issues/1261
Certain event listens are being added twice due to the way we "reload"
the MembersAPI which can cause duplicate counts of Offer Redemptions.
Rather than creating multiple instances of the MembersAPI we're moving
toward being able to reload the config in place or passing getters for
the config which will allows us to use the MembersAPI as a singleton,
and remove any bugs which come from creating multiple instances.
This also fixes a bug with the allowSelfSignup config not refreshing when
the portal_plans setting was changed.
refs https://github.com/TryGhost/Team/issues/1268
- bumps `@tryghost/kg-mobiledoc-html-renderer` which changes email rendering for rich-text blockquote sections so the contents is wrapped in `<p>`. E.g. `<blockquote>Text</blockquote>` becomes `<blockquote><p>Text</p></blockquote>`
- in iOS Mail which has hardcoded/un-overridable `blockquote` styles that remove all margins it lets the `p` margins take effect to add back the missing vertical spacing. The change had no noticeable effect on other clients when testing
Co-authored-by: Renovate Bot <bot@renovateapp.com>
refs https://github.com/TryGhost/Team/issues/1258
- members auto login after Stripe checkout feature is GA so labs flag is no longer necessary
- bumps `@tryghost/members-api` to version that does not use the labs flag
refs https://github.com/TryGhost/Team/issues/1259
- We don't correctly handle Nodemailer's EENVELOPE error, which is thrown when Mailgun returns an error due to an invalid email recipient
- We don't want to default to returning a 400 for all mail exceptions because this would mask genuine errors - for example if Mailgun is unavailable
- We should catch `code: EENVELOPE` errors and return a 400 response
refs https://github.com/TryGhost/Team/issues/1231
refs a7ef81bf95
- the referenced commit adds the `download` property to File cards
- this commit bumps the `@tryghost/kg-default-cards` package to include
that change
no-issue
This includes updates to the html parsers for creating mobiledoc cards
and now works for the before/after cards, as well as fixes for
classnames of existing cards
refs https://github.com/TryGhost/Team/issues/1249
Using an input as the slider handle meant setting a width of 100% + px,
which could push width over the size of the screen - not good! This
takes the same approach as the CodePen linked below and uses a separate
element, which has the position of it updated by JS in realtime.
https://codepen.io/josephwong2004/pen/NWRGxdR
refs https://github.com/TryGhost/Team/issues/1245
- Ensures a warning is displayed when the theme doesn't include the default product card css and also doesn't style style the product card.
no issue
- we've been battling an issue where we have multiple versions of the
logging library running, which causes a problem with file rotation
- this package adds a resolution to v2 so we force the use of a single
version within Ghost
refs https://github.com/TryGhost/Team/issues/1249
- Initial version of rendering for the Before/After card from moi
- Updates to the audio cards class names from Sanne
- Fixes to the audio card thumbnail in emails from Sanne
- Refactor of product card rendering from Thibaut
refs https://github.com/TryGhost/gscan/issues/417
- The `@partial-block` handlebars directive was allowed in previous gscan versions until a regression
- Always allow using `@partial-block` as it never breaks the handlebars rendering
Co-authored-by:
- Thibaut Patel @tpatel
- Renovate Bot <bot@renovateapp.com>
refs https://github.com/TryGhost/Team/issues/1229
- bumped `@tryghost/kg-default-cards` with improved handling of thumbnail aspect ratio and a bugfix for the `loop` attribute on the `<video>` element
refs https://github.com/TryGhost/Team/issues/1230
- updates payload attributes set by audio card in frontend template
- updates use of duration and post url link on audio card in email template
- updates parser plugin for audio card
- updates tests
refs https://github.com/TryGhost/Toolbox/issues/158
- Allows for much smaller amount of code to configure a test to work with chai-jest-snapshots. They now work automatically for all regression tests and could be enabled for other suites by adding the "--require=./test/utils/snapshots.js" parameter in respective test:* package script
- Regenerated snapshot for authentication test as the naming structure
changed a little with the snapshot metadata being taken on a higher
level in the test (uses the suite name instead of a specific describe it
used to be called from)
refs https://github.com/TryGhost/Team/issues/1229
- bumped @tryghost/kg-default-cards that contains initial video card rendering
- added video card CSS file with basic style that prevents video element rendering larger than the content width (similar to default image styles in most themes)
refs: https://github.com/TryGhost/Toolbox/issues/146
Switched to @tryghost/logging instead of passing around the library. The main sticking points of this change are jobs. When jobs are launched we don't want them to use a separate @tryghost/logging instance because they would start parallel rotation jobs. @tryghost/logging v2.x passes all logs to the parent process if run in a child process, so that we can use the same patterns in jobs and the rest of the codebase.
refs https://github.com/TryGhost/Team/issues/1239
- bumped the mobiledoc-to-html renderer so it doesn't add the `kg-width-wide` class when rendering `aside` sections to `<blockquote>`
refs https://github.com/TryGhost/Team/issues/789
We are still having issues with duplicate subscriptiosn being inserted
and are unable to determine why. We are now catching these DB errors and
responding with a 409 Conflict rather than 500 Internal Server Error.
This buys us some time to solve the underlying problem, whilst not
alerting on-call engineers.
no refs
- Updated the css classes from `kg-card-callout*` to `kg-callout-card*` for the callout card. This improves consistency with the other cards' css.
refs https://github.com/TryGhost/Team/issues/1202
We were storing all possible columns for a member, rather than the ones
sent up in the CSV - this was causing updates to existing members to
have their data removed. This fix means that we only store the columns
that were sent up in the CSV - so that missing columns are not affected.
closesTryGhost/Team#1238
- previously returned 500 errors when a subscription had invalid number of prices due to external tampering on Stripe directly
- instead now returns 400 Bad Request error when subscriptions don't have right number of prices
refs: TryGhost/Toolbox#147
* Replaces all references to isIgnitionError with isGhostError
* Switches use of GhostError to InternalServerError - as GhostError is no longer public
There are places where InternalServerError is not the valid error, and new errors should be added to the @tryghost/errors package to ensure that we can use semantically correct errors in those cases.
no refs
- In the custom theme settings, the `color` default error was saying `null` and empty string values were allowed. They weren't. The description is now fixed
refs https://github.com/TryGhost/Team/issues/1243
When invalid subscriptions without any price data are included in the
API, we are faced with errors due to the data being in an undefined
state. This updates the API to not respond with these invalid
subscriptions.
refs https://github.com/TryGhost/Team/issues/1001
We fall back to existing behaviour if no API key is present, or if there
is an error communicating with the Twitter API. We're also currently
requesting all the data, which will be thinned down once we understand
what we need.
This also includes a custom renderer for embeds of type "twitter" which
will be used to output the custom HTML for emails
refs: https://github.com/TryGhost/Toolbox/issues/105
Lint rules prevent:
* Invalid naming conventions for new migrations
* Loop constructs in migrations - these should be used with caution
and are therefore a warning rule, use `// eslint-disable-next-line
no-restricted-syntax` to prevent this rule from firing where a loop is
required
* Returing within a loop - this is usually meant to be a
continue/break
* Multiple joins - these can be badly performing migrations, so should
be treated with caution, disable the rule for the line if the risk is
understood / the migration cannot be written without it
refs https://github.com/TryGhost/Team/issues/1239
- bumps `@tryghost/html-to-mobiledoc` that uses a new parser plugin for transforming `<blockquote class="kg-blockquote-alt">` to an `aside` section in mobiledoc as that's what we use as a workaround for storing alternative blockquote style
refs https://github.com/TryGhost/Team/issues/1206
- This add a warning when the `card_asset` config is set so that Ghost doesn't include the callout card css AND the callout card css isn't in the theme
- The update also contains a fix to correctly detect partials named `fill`
- The update also improves the error content when gscan finds an unkown partial
refs https://github.com/TryGhost/Team/issues/1236
We want to ensure that Offers share a name with the correspondent coupon
in Stripe, which have a max length of 40 characters, so we are applying
the same restriction to Offers.