Open alusev opened 5 years ago
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 types/nodemailer
version to 6.1.0
and then the problem was solved. I also noticed that this bug is present since the 6.2.2
version.
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" <hi@enking.dev>',
to: 'someone@github.com',
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'.