File tree Expand file tree Collapse file tree
src/templates/emails/event Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858{% endblock %}
5959
6060{% block unsubscribeLink %}
61- {{ host ~ ' /unsubscribe/' ~ project ._id }}
61+ {{ host ~ ' /unsubscribe/' ~ project ._id ~ ' / ' ~ notificationRuleId }}
6262{% endblock %}
6363
6464{% block unsubscribeText %}
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ describe('EmailProvider', () => {
8181 period : 60 ,
8282 host : process . env . GARAGE_URL ! ,
8383 hostOfStatic : process . env . API_STATIC_URL ! ,
84+ notificationRuleId : '5d206f7f9aaf7c0071d64596' ,
8485 project : {
8586 _id : new ObjectId ( '5d206f7f9aaf7c0071d64596' ) ,
8687 token : 'project-token' ,
@@ -131,6 +132,7 @@ describe('EmailProvider', () => {
131132 } ] ,
132133 host : process . env . GARAGE_URL ! ,
133134 hostOfStatic : process . env . API_STATIC_URL ! ,
135+ notificationRuleId : '5d206f7f9aaf7c0071d64596' ,
134136 project : {
135137 _id : new ObjectId ( '5d206f7f9aaf7c0071d64596' ) ,
136138 token : 'project-token' ,
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ export default abstract class SenderWorker extends Worker {
196196 project,
197197 events : eventsData ,
198198 period : channel . minPeriod ,
199+ notificationRuleId : rule . _id ,
199200 } ,
200201 } as EventNotification | SeveralEventsNotification ) ;
201202 }
Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ export interface EventsTemplateVariables extends CommonTemplateVariables {
4545 * Minimal pause between second notification, in seconds
4646 */
4747 period : number ;
48+
49+ /**
50+ * Id of notification rule to unsubscribe.
51+ * Required for email notifications – to form unsubscribe link.
52+ */
53+ notificationRuleId ?: string ;
4854}
4955
5056/**
You can’t perform that action at this time.
0 commit comments