I am trying to implement a method, that takes a template identifier and the respective template parameters and then returns the rendered email template.
However I cannot get the generic types to work so that Typescript doesn't throw an error.
No matter what I try I always get
Type '{ email: string; } | { someOtherProp: number; newEmail: string; }' is not assignable to type 'IntrinsicAttributes & { email: string; } & { someOtherProp: number; newEmail: string; }'.
Type '{ email: string; }' is missing the following properties from type '{ someOtherProp: number; newEmail: string; }': someOtherProp, newEmail
Any help would be greatly appreciated!
Is there a way to do this with Typescript?
I have a code example below:

