diff --git a/.changeset/lazy-dots-occur.md b/.changeset/lazy-dots-occur.md new file mode 100644 index 0000000..f284550 --- /dev/null +++ b/.changeset/lazy-dots-occur.md @@ -0,0 +1,5 @@ +--- +"@ahmedayob/email-toolkit": patch +--- + +build fix diff --git a/src/EmailBuilder/EmailBuilder.ts b/src/EmailBuilder/EmailBuilder.ts index 1edcefa..21ee67b 100644 --- a/src/EmailBuilder/EmailBuilder.ts +++ b/src/EmailBuilder/EmailBuilder.ts @@ -46,7 +46,6 @@ export class EmailBuilder implements EmailBuilderClass { headers: HeadersType, attachments?: AttachmentType[] ): string | EmailError { - const MessageBody = this.formatMessageBody(); if (!this.messagebody) { return new EmailError({ message: "MessageBody is missed", @@ -64,7 +63,7 @@ export class EmailBuilder implements EmailBuilderClass { `

To: ${headers.To}

`, `---------------------------------`, ``, - `${MessageBody}`, + `${this.messagebody}`, ``, ``, ``, @@ -124,15 +123,6 @@ export class EmailBuilder implements EmailBuilderClass { return Base64.encodeToBase64(rawMessage); } - /** - * Encodes the message body in Base64 format. - * - * @returns {string} The encoded message body. - */ - public getEncodedMessageBody(): string { - return this.formatMessageBody(); - } - /** * Generates the signature block for the email. * @@ -150,14 +140,4 @@ export class EmailBuilder implements EmailBuilderClass { ``, ]; } - - /** - * Formats the message body and encodes it in Base64. - * - * @private - * @returns {string} The formatted and encoded message body. - */ - private formatMessageBody(): string { - return Base64.encodeToBase64(this.messagebody as string); - } } diff --git a/src/EmailBuilder/__test__/EmailBuilder.test.ts b/src/EmailBuilder/__test__/EmailBuilder.test.ts index 924ffa9..719bdf7 100644 --- a/src/EmailBuilder/__test__/EmailBuilder.test.ts +++ b/src/EmailBuilder/__test__/EmailBuilder.test.ts @@ -55,12 +55,6 @@ describe("EmailBuilder", () => { ); }); - it("should encode the message body in Base64", () => { - emailBuilder.messagebody = "This is a test email."; - const encodedBody = emailBuilder.getEncodedMessageBody(); - expect(encodedBody).toBe(Base64.encodeToBase64("This is a test email.")); - }); - it("should generate the correct signature block", () => { const signature = emailBuilder.getSignature({ from: "sender@example.com",