-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript: 'template' does not exist in type 'Options' #79
Comments
Any news on this error? I have the same problem! |
Any updates ? |
any updates? |
As we don't have an official solution yet, I just downgraded my |
Facing the same issue :/ |
Any updates? |
You could just extend the Options type like this: import { Options } from "nodemailer/lib/mailer";
type ExtendedOptions = Options & { template: string, context: Record<string, unknown> };
const options: ExtendedOptions = {
from: '"enyineer@github" <[email protected]>',
to: '[email protected]',
template: 'myTemplateName',
context: {
foo: 'bar',
},
};
await transport.sendMail(options); Fixes the TypeScript complaint until the types are corrected. |
I cannot specify a template. I have the following code:
This is the error:
Object literal may only specify known properties, and 'template' does not exist in type 'Options'.
The text was updated successfully, but these errors were encountered: