Fullstak-nl / medusa-plugin-postmark

Postmark notification plugin for MedusaJS
https://fullstak-nl.github.io/medusa-plugin-postmark/
MIT License
12 stars 1 forks source link

An error occured while postmark was processing a notification for customer.created #4

Open usamaadev opened 9 months ago

usamaadev commented 9 months ago
0|yarn dev  | info:    Processing customer.created which has 0 subscribers
0|yarn dev  | InvalidEmailRequestError: Zero recipients specified.
0|yarn dev  |     at ApiInputError.buildSpecificError (/home/rooot/project/node_modules/postmark/dist/client/errors/Errors.js:122:24)
0|yarn dev  |     at ErrorHandler.buildErrorByHttpStatusCode (/home/rooot/project/node_modules/postmark/dist/client/errors/ErrorHandler.js:43:45)
0|yarn dev  |     at ErrorHandler.buildError (/home/rooot/project/node_modules/postmark/dist/client/errors/ErrorHandler.js:26:25)
0|yarn dev  |     at AxiosHttpClient.transformError (/home/rooot/project/node_modules/postmark/dist/client/HttpClient.js:93:38)
0|yarn dev  |     at /home/rooot/project/node_modules/postmark/dist/client/HttpClient.js:77:41
0|yarn dev  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
0|yarn dev  |   statusCode: 422,
0|yarn dev  |   code: 300
0|yarn dev  | }
0|yarn dev  | QueryFailedError: null value in column "to" violates not-null constraint
0|yarn dev  |     at PostgresQueryRunner.query (/home/rooot/project/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
0|yarn dev  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0|yarn dev  |     at async InsertQueryBuilder.execute (/home/rooot/project/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
0|yarn dev  |     at async SubjectExecutor.executeInsertOperations (/home/rooot/project/node_modules/typeorm/persistence/SubjectExecutor.js:260:42)
0|yarn dev  |     at async SubjectExecutor.execute (/home/rooot/project/node_modules/typeorm/persistence/SubjectExecutor.js:92:9)
0|yarn dev  |     at async EntityPersistExecutor.execute (/home/rooot/project/node_modules/typeorm/persistence/EntityPersistExecutor.js:140:21) {
0|yarn dev  |   query: 'INSERT INTO "public"."notification"("id", "created_at", "updated_at", "event_name", "resource_type", "resource_id", "customer_id", "to", "data", "parent_id", "provider_id") VALUES ($1, DEFAULT, DEFAULT, $2, $3, $4, $5, DEFAULT, $6, DEFAULT, $7) RETURNING "created_at", "updated_at"',
0|yarn dev  |   parameters: [
0|yarn dev  |     'noti_01HMF1MP79NFFH5T02JEEPEVDD',
0|yarn dev  |     'customer.created',
0|yarn dev  |     'customer',
0|yarn dev  |     'cus_01HMF1MMQ9S9F1JRM4DR18WQSF',
0|yarn dev  |     null,
0|yarn dev  |     '{"From":"XYZ","TemplateId":"34513370","TemplateModel":{"product_url":"","product_name":"","company_name":"XYZ","company_address":"XYZ"}}',
0|yarn dev  |     'postmark'
0|yarn dev  |   ],

I am getting an error for the event of "customer.created", all other emails are sent successfully like on order creation etc.

Fullstak-nl commented 9 months ago

Hello @usamaadev

Thank you for your issue. I will release a patch tomorrow which will fix this.

Thank you