-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(classes): allow template variables
- Loading branch information
Showing
4 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 +1,6 @@ | ||
{ | ||
"name": "@nextnm/nestjs-mailgun", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "NestJS provider for sending emails with mailgun", | ||
"author": "Nuno Carvalhão <[email protected]>", | ||
"license": "MIT", | ||
|
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { EmailOptions } from '../services/relay/mailgun.service'; | ||
|
||
export class MailgunEmailModel implements EmailOptions { | ||
public 'h:X-Mailgun-Variables'?: string; | ||
|
||
constructor( | ||
public from: string, | ||
public to: string | string[], | ||
public subject: string, | ||
public text?: string, | ||
public html?: string, | ||
public template?: string, | ||
public attachment?: any, | ||
public templateVariables?: { [key: string]: any }, | ||
) { | ||
this['h:X-Mailgun-Variables'] = templateVariables | ||
? JSON.stringify(templateVariables) | ||
: this['h:X-Mailgun-Variables']; | ||
} | ||
} |
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