andrechristikan / ack-nestjs-boilerplate

NestJs v10.x Boilerplate. Repository Design Pattern. MongoDB (Mongoose). Containerization.
MIT License
536 stars 182 forks source link

Welcome Email doesn't work due to buggy code #525

Closed horizon-dev-group closed 4 days ago

horizon-dev-group commented 2 months ago

[Nest] 29976 - 08/20/2024, 4:17:58 PM ERROR [EmailProcessor] TypeError: Cannot destructure property 'name' of 'undefined' as it is undefined.

A quick fix is something like this:

instead of this:

this.emailQueue.add(
                ENUM_EMAIL.WELCOME,
                {
                    email,
                    name,
                },
                {
                    debounce: {
                        id: `${ENUM_EMAIL.WELCOME}-${user._id}`,
                        ttl: 1000,
                    },
                }
            );

we do this:

this.emailQueue.add(
                ENUM_EMAIL.WELCOME,
                {
                    send: {
                        email,
                        name,
                    },
                },
                {
                    debounce: {
                        id: `${ENUM_EMAIL.WELCOME}-${user._id}`,
                        ttl: 1000,
                    },
                }
            );
andrechristikan commented 1 month ago

Ahh yes, u right i will fix it