mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
feat: unsubscribe link to user profile (#8637)
This commit is contained in:
parent
08d0e45de5
commit
6f09bcdee1
@ -169,8 +169,11 @@ test('Can send productivity report email', async () => {
|
|||||||
health: 99,
|
health: 99,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(content);
|
|
||||||
expect(content.from).toBe('noreply@getunleash.ai');
|
expect(content.from).toBe('noreply@getunleash.ai');
|
||||||
expect(content.subject).toBe('Unleash - productivity report');
|
expect(content.subject).toBe('Unleash - productivity report');
|
||||||
expect(content.html.includes(`Productivity Report`)).toBe(true);
|
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);
|
||||||
});
|
});
|
||||||
|
@ -537,14 +537,11 @@ export class EmailService {
|
|||||||
},
|
},
|
||||||
): Promise<IEmailEnvelope> {
|
): Promise<IEmailEnvelope> {
|
||||||
if (this.configured()) {
|
if (this.configured()) {
|
||||||
const unsubscribeUrl = '{{amazonSESUnsubscribeUrl}}'; // FIXME: Add unsubscribe URL
|
|
||||||
|
|
||||||
const context = {
|
const context = {
|
||||||
userName,
|
userName,
|
||||||
userEmail,
|
userEmail,
|
||||||
...metrics,
|
...metrics,
|
||||||
unleashUrl: this.config.server.unleashUrl,
|
unleashUrl: this.config.server.unleashUrl,
|
||||||
unsubscribeUrl,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const template = 'productivity-report';
|
const template = 'productivity-report';
|
||||||
|
@ -72,9 +72,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="unsubscribe" style="font-size: 12px;color: #888;margin-top: 10px;">
|
<div class="unsubscribe" style="font-size: 12px;color: #888;margin-top: 10px;">
|
||||||
This email was sent to {{userEmail}}. You’ve received this as you are a user of Unleash.<br>
|
This email was sent to {{userEmail}}. You’ve received this as you are a user of Unleash.<br>
|
||||||
{{#unsubscribeUrl}}
|
If you wish to unsubscribe, go to you profile settings <a href="{{unleashUrl}}/profile">here</a>.
|
||||||
If you wish to unsubscribe, click <a href="{{unsubscribeUrl}}">here</a>.
|
|
||||||
{{/unsubscribeUrl}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,6 +14,4 @@ Production updates last month: {{productionUpdates}}
|
|||||||
Go to your Insights to learn more: {{unleashUrl}}/insights
|
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.
|
This email was sent to {{userEmail}}. You’ve received this as you are a user of Unleash.
|
||||||
{{#unsubscribeUrl}}
|
If you wish to unsubscribe, go to you profile settings <a href="{{unleashUrl}}/profile">here</a>.
|
||||||
If you wish to unsubscribe, click <a href="{{unsubscribeUrl}}">here</a>.
|
|
||||||
{{/unsubscribeUrl}}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user