feat(SzPlatformClient): Add debug mode functionality to SzPlatformClient and SzEmailConnector
This commit is contained in:
@ -13,13 +13,18 @@ export class SzEmailConnector {
|
||||
public async sendEmail(
|
||||
optionsArg: plugins.servezoneInterfaces.platformservice.mta.IRequest_SendEmail['request']
|
||||
) {
|
||||
if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) {
|
||||
if (this.platformClientRef.debugMode) {
|
||||
logger.log('info', `sent email with subject ${optionsArg.title} to ${optionsArg.to}
|
||||
body:
|
||||
${optionsArg.body.split('\n').map(line => ` ${line}`).join('\n')}
|
||||
|
||||
`);
|
||||
}
|
||||
|
||||
if (this.platformClientRef.debugMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
const typedRequest =
|
||||
this.platformClientRef.typedsocket.createTypedRequest<plugins.servezoneInterfaces.platformservice.mta.IRequest_SendEmail>(
|
||||
'sendEmail'
|
||||
|
Reference in New Issue
Block a user