fix(core): update

This commit is contained in:
2019-10-26 23:45:35 +02:00
parent 390e0f7b9e
commit 1244956187
10 changed files with 1440 additions and 429 deletions

View File

@ -1,11 +1,33 @@
import * as plugins from './smartmail.plugins';
export interface ISmartmailOptions {
from: string;
subject: string;
body: string;
}
/**
* a standard representation for mails
*/
export class Smartmail {
from: string;
to: string;
body: string;
attachments: any[];
public options: ISmartmailOptions;
public attachments: plugins.smartfile.Smartfile[];
constructor(optionsArg: ISmartmailOptions) {
this.options = optionsArg;
}
public addAttachment(smartfileArg: plugins.smartfile.Smartfile) {
this.attachments.push(smartfileArg);
}
public getSubject(dataArg: any = {}) {
const smartmustache = new plugins.smartmustache.SmartMustache(this.options.subject);
return smartmustache.applyData(dataArg);
}
public getBody(dataArg: any = {}) {
const smartmustache = new plugins.smartmustache.SmartMustache(this.options.body);
return smartmustache.applyData(dataArg);
}
}

View File

@ -1,2 +1,7 @@
const removeme = {};
export { removeme };
import * as smartfile from '@pushrocks/smartfile';
import * as smartmustache from '@pushrocks/smartmustache';
export {
smartfile,
smartmustache
};