GithubHelp home page GithubHelp logo

Comments (12)

cdiaz avatar cdiaz commented on August 23, 2024 4

Thanks, sorry for the delay, it is already fixed in 1.1.3 version

from mailer.

justinlazaro-ubidy avatar justinlazaro-ubidy commented on August 23, 2024 3

temporary fix.

image

from mailer.

mfeldmeier avatar mfeldmeier commented on August 23, 2024

Hello,

I have the same Problem.
In the new version is the ISendMailOptions required but there is no params for: To, Cc, Bcc, From.
See here:

import { SendMailOptions } from 'nodemailer';
export interface ISendMailOptions extends SendMailOptions {
    template?: string;
    context?: {
        [name: string]: any;
    };
}

So be careful to Update to the Nestjs version 6.x because the Mailer isn't working at the moment.

Any solutions?

from mailer.

mfeldmeier avatar mfeldmeier commented on August 23, 2024

@MegaphoneCA super strange I just removed the class for sendMailOptions:

// from
import { SentMessageInfo } from 'nodemailer';
/** Interfaces **/
import { MailerOptions } from './interfaces/mailer-options.interface';
import { ISendMailOptions } from './interfaces/send-mail-options.interface';
export declare class MailerService {
    private readonly mailerOptions;
    private transporter;
    constructor(mailerOptions: MailerOptions);
    sendMail(sendMailOptions: ISendMailOptions): Promise<SentMessageInfo>;
}
// to
import { SentMessageInfo } from 'nodemailer';
/** Interfaces **/
import { MailerOptions } from './interfaces/mailer-options.interface';
import { ISendMailOptions } from './interfaces/send-mail-options.interface';
export declare class MailerService {
    private readonly mailerOptions;
    private transporter;
    constructor(mailerOptions: MailerOptions);
    sendMail(sendMailOptions): Promise<SentMessageInfo>;
}

After reloading Nest App it should be working than.
After this you can add the Class to the Options and reload again and it still working.

Maybe it's a caching problem?
I uninstalled the Package and install it again and its still working.

How?

from mailer.

 avatar commented on August 23, 2024

I'm confused, with your instructions... Can you clarify exactly what steps I need to take?

from mailer.

mfeldmeier avatar mfeldmeier commented on August 23, 2024

Go to the mailer.service.d.ts :

import { SentMessageInfo } from 'nodemailer';
/** Interfaces **/
import { MailerOptions } from './interfaces/mailer-options.interface';
import { ISendMailOptions } from './interfaces/send-mail-options.interface';
export declare class MailerService {
    private readonly mailerOptions;
    private transporter;
    constructor(mailerOptions: MailerOptions);
    sendMail(sendMailOptions: ISendMailOptions): Promise<SentMessageInfo>;
}

In the sendMail function is the parameter sendMailOptions. This is from Type ISendMailOptions
Remove this at first, save the file and reload your application.

Now you shouldn't get any error.

Go again to this file and add ISendMailOptions to the sendMailOptions.

sendMailOptions:ISendMailOptions

Save again and reload your application.
This works for me and all is working now.

Is that easier to understand?

from mailer.

 avatar commented on August 23, 2024

That wasn't the part I found confusing. I am hoping for a fix that will be integrated into the project and not something I have to do myself.

Will the code you shared be integrated into the NPM version? If I change the code in my node_modules folder than it is only local and won't carry over to my production environment.

from mailer.

mfeldmeier avatar mfeldmeier commented on August 23, 2024

It's weird.
Because I change it and put it back again.
It looks like a bug but it would work.
So I don't know if or how you can fix something like that in an npm module.

Maybe this is just a temporary fix.

from mailer.

ahmadarif avatar ahmadarif commented on August 23, 2024

I've the same problem, and downgrade to v1.0.4 :D

from mailer.

justinlazaro-ubidy avatar justinlazaro-ubidy commented on August 23, 2024

i have a same issue here. hoping for documentation about the implementation.

export interface ISendMailOptions extends SendMailOptions {
    template?: string;
    context?: {
        [name: string]: any;
    };
}

from mailer.

nelsonBlack avatar nelsonBlack commented on August 23, 2024

temporary fix.

image

working temporary fix for sendmail options in NestJS V6, hope fix is added to support v6

from mailer.

justinlazaro-ubidy avatar justinlazaro-ubidy commented on August 23, 2024

@cdiaz thanks

from mailer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.