Skip to content

Commit

Permalink
Merge pull request #2226 from ArturHamannRonconi/fix/ses-provider-sen…
Browse files Browse the repository at this point in the history
…der-name

fix: use sender name with from email in ses provider
  • Loading branch information
scopsy committed Dec 12, 2022
2 parents 859b570 + 25ab4a1 commit 73d9612
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class SESHandler extends BaseHandler {
region: credentials.region,
accessKeyId: credentials.apiKey,
secretAccessKey: credentials.secretKey,
senderName: credentials.senderName ?? 'no-reply',
from,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class SESHandler extends BaseHandler {
region: credentials.region,
accessKeyId: credentials.apiKey,
secretAccessKey: credentials.secretKey,
senderName: credentials.senderName ?? 'no-reply',
from,
};

Expand Down
3 changes: 2 additions & 1 deletion providers/ses/src/lib/ses.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface SESConfig {
from: string;
region: string;
senderName: string;
accessKeyId: string;
secretAccessKey: string;
from: string;
}
5 changes: 3 additions & 2 deletions providers/ses/src/lib/ses.provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ test('should trigger ses library correctly', async () => {
});

const mockConfig = {
from: 'test@test.com',
region: 'test-1',
senderName: 'Test',
accessKeyId: 'TEST',
from: 'test@test.com',
secretAccessKey: 'TEST',
region: 'test-1',
};
const provider = new SESEmailProvider(mockConfig);

Expand Down
7 changes: 5 additions & 2 deletions providers/ses/src/lib/ses.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ export class SESEmailProvider implements IEmailProvider {
});

return await transporter.sendMail({
to,
html,
text,
to,
from,
subject,
attachments,
from: {
address: from,
name: this.config.senderName,
},
});
}

Expand Down

0 comments on commit 73d9612

Please sign in to comment.