Skip to content

Commit

Permalink
fix: build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wildduck2 committed Aug 9, 2024
1 parent 2e6812f commit 5f0d578
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-dots-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ahmedayob/email-toolkit": patch
---

build fix
22 changes: 1 addition & 21 deletions src/EmailBuilder/EmailBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -64,7 +63,7 @@ export class EmailBuilder implements EmailBuilderClass {
`<p>To: ${headers.To}</p>`,
`---------------------------------`,
``,
`${MessageBody}`,
`${this.messagebody}`,
``,
`</div>`,
``,
Expand Down Expand Up @@ -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.
*
Expand All @@ -150,14 +140,4 @@ export class EmailBuilder implements EmailBuilderClass {
`</div>`,
];
}

/**
* 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);
}
}
6 changes: 0 additions & 6 deletions src/EmailBuilder/__test__/EmailBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]",
Expand Down

0 comments on commit 5f0d578

Please sign in to comment.