Browse Source

feat(email-plugin): Use full Nodemailer SMTPTransport options (#1781)

Hendrik Depauw 3 years ago
parent
commit
86b12bc821
1 changed files with 3 additions and 61 deletions
  1. 3 61
      packages/email-plugin/src/types.ts

+ 3 - 61
packages/email-plugin/src/types.ts

@@ -2,6 +2,7 @@ import { LanguageCode } from '@vendure/common/lib/generated-types';
 import { Omit } from '@vendure/common/lib/omit';
 import { Injector, RequestContext, VendureEvent } from '@vendure/core';
 import { Attachment } from 'nodemailer/lib/mailer';
+import SMTPTransport from 'nodemailer/lib/smtp-transport';
 
 import { EmailEventHandler } from './event-handler';
 
@@ -127,58 +128,13 @@ export type EmailTransportOptions =
 
 /**
  * @description
- * A subset of the SMTP transport options of [Nodemailer](https://nodemailer.com/smtp/)
+ * The SMTP transport options of [Nodemailer](https://nodemailer.com/smtp/)
  *
  * @docsCategory EmailPlugin
  * @docsPage Transport Options
  */
-export interface SMTPTransportOptions {
+export interface SMTPTransportOptions extends SMTPTransport.Options {
     type: 'smtp';
-    /**
-     * @description
-     * the hostname or IP address to connect to (defaults to ‘localhost’)
-     */
-    host: string;
-    /**
-     * @description
-     * The port to connect to (defaults to 25 or 465)
-     */
-    port: number;
-    /**
-     * @description
-     * Defines authentication data
-     */
-    auth: SMTPCredentials;
-    /**
-     * @description
-     * Defines if the connection should use SSL (if true) or not (if false)
-     */
-    secure?: boolean;
-    /**
-     * @description
-     * Turns off STARTTLS support if true
-     */
-    ignoreTLS?: boolean;
-    /**
-     * @description
-     * Forces the client to use STARTTLS. Returns an error if upgrading the connection is not possible or fails.
-     */
-    requireTLS?: boolean;
-    /**
-     * @description
-     * Optional hostname of the client, used for identifying to the server
-     */
-    name?: string;
-    /**
-     * @description
-     * The local interface to bind to for network connections
-     */
-    localAddress?: string;
-    /**
-     * @description
-     * Defines preferred authentication method, e.g. ‘PLAIN’
-     */
-    authMethod?: string;
     /**
      * @description
      * If true, uses the configured {@link VendureLogger} to log messages from Nodemailer as it interacts with
@@ -187,20 +143,6 @@ export interface SMTPTransportOptions {
      * @default false
      */
     logging?: boolean;
-    /**
-     * @description
-     * If set to true, then logs SMTP traffic without message content.
-     *
-     * @default false
-     */
-    transactionLog?: boolean;
-    /**
-     * @description
-     * If set to true, then logs SMTP traffic and message content, otherwise logs only transaction events.
-     *
-     * @default false
-     */
-    debug?: boolean;
 }
 
 /**