-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(email-plugin): Add support for dynamic templates & SMTP settings
- Loading branch information
1 parent
d628659
commit c6686cd
Showing
9 changed files
with
292 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import { EmailPluginDevModeOptions, EmailPluginOptions } from './types'; | ||
import { Injector, RequestContext } from '@vendure/core'; | ||
|
||
import { EmailPluginDevModeOptions, EmailPluginOptions, EmailTransportOptions } from './types'; | ||
|
||
export function isDevModeOptions( | ||
input: EmailPluginOptions | EmailPluginDevModeOptions, | ||
): input is EmailPluginDevModeOptions { | ||
return (input as EmailPluginDevModeOptions).devMode === true; | ||
} | ||
|
||
export async function resolveTransportSettings( | ||
options: EmailPluginOptions, | ||
injector: Injector, | ||
ctx?: RequestContext | ||
): Promise<EmailTransportOptions> { | ||
if (typeof options.transport === 'function') { | ||
return options.transport(injector, ctx); | ||
} else { | ||
return options.transport; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.