diff --git a/changelog.md b/changelog.md index 21bc0bd..280bb7a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2024-10-02 - 1.0.11 - fix(email,sms) +Reorder debug logging to avoid confusion in email and sms connectors + +- Reordered the logging after request creation in `sendEmail` method of `SzEmailConnector` +- Reordered the logging after request creation in `sendSms` method of `SzSmsConnector` + ## 2024-10-02 - 1.0.10 - fix(build) Fix build script configuration and plugins import path diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index ec88ac6..e0016ee 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/platformclient', - version: '1.0.10', + version: '1.0.11', description: 'a module that makes it really easy to use the serve.zone platform inside your app' } diff --git a/ts/email/classes.emailconnector.ts b/ts/email/classes.emailconnector.ts index 40da043..865cac2 100644 --- a/ts/email/classes.emailconnector.ts +++ b/ts/email/classes.emailconnector.ts @@ -13,12 +13,6 @@ export class SzEmailConnector { public async sendEmail( optionsArg: plugins.servezoneInterfaces.platformservice.mta.IRequest_SendEmail['request'] ) { - const typedRequest = - this.platformClientRef.typedsocket.createTypedRequest( - 'sendEmail' - ); - const response = await typedRequest.fire(optionsArg); - if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) { logger.log('info', `sent email with subject ${optionsArg.title} to ${optionsArg.to} body: @@ -26,6 +20,11 @@ export class SzEmailConnector { `); } + const typedRequest = + this.platformClientRef.typedsocket.createTypedRequest( + 'sendEmail' + ); + const response = await typedRequest.fire(optionsArg); } diff --git a/ts/email/classes.smsconnector.ts b/ts/email/classes.smsconnector.ts index 354cea2..79bee70 100644 --- a/ts/email/classes.smsconnector.ts +++ b/ts/email/classes.smsconnector.ts @@ -10,11 +10,6 @@ export class SzSmsConnector { } public async sendSms(messageArg: plugins.servezoneInterfaces.platformservice.sms.IRequest_SendSms['request']) { - const typedrequest = this.platformClientRef.typedsocket.createTypedRequest( - 'sendSms' - ); - const response = await typedrequest.fire(messageArg); - if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) { logger.log('info', `sent sms to ${messageArg.toNumber}} body: @@ -22,7 +17,11 @@ export class SzSmsConnector { `); } - + + const typedrequest = this.platformClientRef.typedsocket.createTypedRequest( + 'sendSms' + ); + const response = await typedrequest.fire(messageArg); return response.status; }