diff --git a/src/lib/services/email-service.test.ts b/src/lib/services/email-service.test.ts index a8a914a37eb0..a25a6ce7e0df 100644 --- a/src/lib/services/email-service.test.ts +++ b/src/lib/services/email-service.test.ts @@ -169,8 +169,11 @@ test('Can send productivity report email', async () => { health: 99, }, ); - console.log(content); expect(content.from).toBe('noreply@getunleash.ai'); expect(content.subject).toBe('Unleash - productivity report'); expect(content.html.includes(`Productivity Report`)).toBe(true); + expect(content.html.includes(`localhost/insights`)).toBe(true); + expect(content.html.includes(`localhost/profile`)).toBe(true); + expect(content.text.includes(`localhost/insights`)).toBe(true); + expect(content.text.includes(`localhost/profile`)).toBe(true); }); diff --git a/src/lib/services/email-service.ts b/src/lib/services/email-service.ts index 155c7d187c94..e7e6bcacb543 100644 --- a/src/lib/services/email-service.ts +++ b/src/lib/services/email-service.ts @@ -537,14 +537,11 @@ export class EmailService { }, ): Promise { if (this.configured()) { - const unsubscribeUrl = '{{amazonSESUnsubscribeUrl}}'; // FIXME: Add unsubscribe URL - const context = { userName, userEmail, ...metrics, unleashUrl: this.config.server.unleashUrl, - unsubscribeUrl, }; const template = 'productivity-report'; diff --git a/src/mailtemplates/productivity-report/productivity-report.html.mustache b/src/mailtemplates/productivity-report/productivity-report.html.mustache index 8bfaece45857..59e93a7f3e82 100644 --- a/src/mailtemplates/productivity-report/productivity-report.html.mustache +++ b/src/mailtemplates/productivity-report/productivity-report.html.mustache @@ -72,9 +72,7 @@
This email was sent to {{userEmail}}. You’ve received this as you are a user of Unleash.
- {{#unsubscribeUrl}} - If you wish to unsubscribe, click here. - {{/unsubscribeUrl}} + If you wish to unsubscribe, go to you profile settings here.
diff --git a/src/mailtemplates/productivity-report/productivity-report.plain.mustache b/src/mailtemplates/productivity-report/productivity-report.plain.mustache index 6f7ccc1f3cd7..4c23236ce4b3 100644 --- a/src/mailtemplates/productivity-report/productivity-report.plain.mustache +++ b/src/mailtemplates/productivity-report/productivity-report.plain.mustache @@ -14,6 +14,4 @@ Production updates last month: {{productionUpdates}} Go to your Insights to learn more: {{unleashUrl}}/insights This email was sent to {{userEmail}}. You’ve received this as you are a user of Unleash. -{{#unsubscribeUrl}} - If you wish to unsubscribe, click here. -{{/unsubscribeUrl}} +If you wish to unsubscribe, go to you profile settings here.