1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

feat: unsubscribe link to user profile (#8637)

This commit is contained in:
Mateusz Kwasniewski 2024-11-04 12:10:32 +01:00 committed by GitHub
parent 08d0e45de5
commit 6f09bcdee1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 10 deletions

View File

@ -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);
});

View File

@ -537,14 +537,11 @@ export class EmailService {
},
): Promise<IEmailEnvelope> {
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';

View File

@ -72,9 +72,7 @@
</div>
<div class="unsubscribe" style="font-size: 12px;color: #888;margin-top: 10px;">
This email was sent to {{userEmail}}. Youve received this as you are a user of Unleash.<br>
{{#unsubscribeUrl}}
If you wish to unsubscribe, click <a href="{{unsubscribeUrl}}">here</a>.
{{/unsubscribeUrl}}
If you wish to unsubscribe, go to you profile settings <a href="{{unleashUrl}}/profile">here</a>.
</div>
</div>
</div>

View File

@ -14,6 +14,4 @@ Production updates last month: {{productionUpdates}}
Go to your Insights to learn more: {{unleashUrl}}/insights
This email was sent to {{userEmail}}. Youve received this as you are a user of Unleash.
{{#unsubscribeUrl}}
If you wish to unsubscribe, click <a href="{{unsubscribeUrl}}">here</a>.
{{/unsubscribeUrl}}
If you wish to unsubscribe, go to you profile settings <a href="{{unleashUrl}}/profile">here</a>.