eleith / emailjs

html emails and attachments to any smtp server with nodejs
MIT License
2.19k stars 230 forks source link

Error Typing... #307

Closed gabrielrincon closed 2 years ago

gabrielrincon commented 2 years ago

Hi there.

I do not know if this is the correct way to create issue.

I used the version 3.8.0

And this is the issue:


node_modules/emailjs/smtp/client.ts:57:28 - error TS2345: Argument of type 'T' is not assignable to parameter of type 'MessageHeaders'.
  Type 'MessageHeaders | Message' is not assignable to type 'MessageHeaders'.
    Type 'Message' is missing the following properties from type 'MessageHeaders': from, to, subject

57                      : this._canMakeMessage(msg)
                                               ~~~

node_modules/emailjs/smtp/client.ts:58:19 - error TS2345: Argument of type 'T' is not assignable to parameter of type 'Partial<MessageHeaders>'.
  Type 'MessageHeaders | Message' is not assignable to type 'Partial<MessageHeaders>'.
    Type 'Message' is not assignable to type 'Partial<MessageHeaders>'.
      Index signature is missing in type 'Message'.

58                      ? new Message(msg)
                                      ~~~
gabrielrincon commented 2 years ago

I suggest on line 50 change: public send( before: public send<T extends Message | MessageHeaders>(

And on line 85: public sendAsync(msg: MessageHeaders) { before; public sendAsync(msg: Message | MessageHeaders) {

What do you think?

gabrielrincon commented 2 years ago

I have this code on a branch... But when I try push it, It give me a error:

git push origin issue307 ERROR: Permission to eleith/emailjs.git denied to gabrielrincon.

What did I do?

  1. I cloned the repo.
  2. I created a branch named issue307
  3. I made the changes.
  4. I made commit
  5. I pushed the repo and I got the error.

How can I contribute this project?

trasherdk commented 2 years ago

Push your changes to your github clone, a make a PR from there.

gabrielrincon commented 2 years ago

Push your changes to your github clone, a make a PR from there.

Thank you very much!

gabrielrincon commented 2 years ago

that its https://github.com/eleith/emailjs/pull/308

zackschuster commented 2 years ago

completed in #310