Skip to content

Commit

Permalink
Add missing mailService in Stripe Hook extension guide (#22450)
Browse files Browse the repository at this point in the history
Co-authored-by: Pascal Jufer <[email protected]>
  • Loading branch information
Oleksii909 and paescuj committed May 9, 2024
1 parent b5b144a commit b76a6e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,6 @@
- jonaskohl
- kimiaabt
- the-other-dev
- Oleksii909
- magiudev
- burka
6 changes: 4 additions & 2 deletions docs/guides/extensions/hooks-add-stripe-customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Use the `ItemsService` to update the customer record. Initialize the service and
stripe.customers
.create({})
.then((customer) => {
const customers = new ItemsService(collection, { schema: schema }); // [!code ++]
const customers = new ItemsService(collection, { schema }); // [!code ++]
customers.updateByQuery({ filter: { id: key } }, { stripe_id: customer.id }, { emitEvents: false }); // [!code ++]
})
.catch((error) => {});
Expand All @@ -117,6 +117,7 @@ stripe.customers
.create({})
.then((customer) => {})
.catch((error) => {
const mailService = new MailService({ schema });
mailService.send({ // [!code ++]
to: '[email protected]', // [!code ++]
from: '[email protected]', // [!code ++]
Expand Down Expand Up @@ -178,10 +179,11 @@ export default ({ action }, { env, services }) => {
email: payload.email_address,
})
.then((customer) => {
const customers = new ItemsService(collection, { schema: schema });
const customers = new ItemsService(collection, { schema });
customers.updateByQuery({ filter: { id: key } }, { stripe_id: customer.id }, { emitEvents: false });
})
.catch((error) => {
const mailService = new MailService({ schema });
mailService.send({
to: '[email protected]',
from: '[email protected]',
Expand Down

0 comments on commit b76a6e8

Please sign in to comment.