Browse Source

fix link in contact request notification

mrkvon 3 years ago
parent
commit
dc8737fd77
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      services/mailer/index.js
  2. 1
    1
      test/contacts.js

+ 1
- 1
services/mailer/index.js View File

@@ -96,7 +96,7 @@ exports.notifyContactRequest = async function ({ from, to, message }) {
96 96
   const hasParameters = Boolean(from && from.username && to && to.email, message);
97 97
   if(!hasParameters) throw dataNotProvided;
98 98
 
99
-  const url = `${config.appUrl.all}/user/${to.username}/contact/${from.username}`;
99
+  const url = `${config.appUrl.all}/contact-with/${from.username}`;
100 100
   const subject = `${from.username} would like to create a contact with you on ditup`;
101 101
 
102 102
   const sanitizedMessage = {

+ 1
- 1
test/contacts.js View File

@@ -54,7 +54,7 @@ describe('contacts', function () {
54 54
       should(email).have.property('to', `<${to.email}>`);
55 55
       should(email).have.property('subject', `${from.username} would like to create a contact with you on ditup`);
56 56
 
57
-      const url = `${config.appUrl.all}/user/${to.username}/contact/${from.username}`;
57
+      const url = `${config.appUrl.all}/contact-with/${from.username}`;
58 58
       should(email).have.property('text').match(new RegExp(`${to.username}(.|\\n)*${from.username}(.|\\n)*${url}(.|\\n)*${message.text}`));
59 59
       should(email).have.property('html').match(new RegExp(`${to.username}(.|\\n)*${from.username}(.|\\n)*${url}(.|\\n)*${message.html}`));
60 60
     }