{"id":76287,"date":"2024-09-10T14:41:53","date_gmt":"2024-09-10T11:11:53","guid":{"rendered":"https:\/\/nabfollower.com\/blog\/how-can-i-automatically-navigate-to-a-page-specified-in-a-link-within-an-email-when-the-user-logs-in-automatically-ka8\/"},"modified":"2024-09-10T14:41:53","modified_gmt":"2024-09-10T11:11:53","slug":"how-can-i-automatically-navigate-to-a-page-specified-in-a-link-within-an-email-when-the-user-logs-in-automatically-ka8","status":"publish","type":"post","link":"https:\/\/nabfollower.com\/blog\/how-can-i-automatically-navigate-to-a-page-specified-in-a-link-within-an-email-when-the-user-logs-in-automatically-ka8\/","title":{"rendered":"\u0686\u06af\u0648\u0646\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646\u0645 \u0628\u0647 \u0637\u0648\u0631 \u062e\u0648\u062f\u06a9\u0627\u0631 \u0628\u0647 \u0635\u0641\u062d\u0647 \u0627\u06cc \u06a9\u0647 \u062f\u0631 \u06cc\u06a9 \u067e\u06cc\u0648\u0646\u062f \u062f\u0631 \u06cc\u06a9 \u0627\u06cc\u0645\u06cc\u0644 \u0645\u0634\u062e\u0635 \u0634\u062f\u0647 \u0627\u0633\u062a\u060c \u0647\u0646\u06af\u0627\u0645\u06cc \u06a9\u0647 \u06a9\u0627\u0631\u0628\u0631 \u0628\u0647 \u0637\u0648\u0631 \u062e\u0648\u062f\u06a9\u0627\u0631 \u0648\u0627\u0631\u062f \u0645\u06cc \u0634\u0648\u062f\u060c \u062d\u0631\u06a9\u062a \u06a9\u0646\u0645\u061f"},"content":{"rendered":"<p>Summarize this content to 400 words in Persian Lang<br \/>\n            \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0628\u0647 \u062a\u0641\u06a9\u06cc\u06a9 \u06a9\u062f \u0648 \u0646\u062d\u0648\u0647 \u06a9\u0627\u0631 \u0622\u0646 \u0645\u06cc \u067e\u0631\u062f\u0627\u0632\u06cc\u0645:<\/p>\n<p>\u0639\u0645\u0644\u06a9\u0631\u062f \u0627\u0631\u0633\u0627\u0644 \u0627\u06cc\u0645\u06cc\u0644<\/p>\n<p>async sendingEmail(email, ndfCollabName, message, numero, intitul\u00e9, Url) {<br \/>\n    const transporter = nodemailer.createTransport({<br \/>\n        host: &#8216;smtp.office365.com&#8217;,<br \/>\n        port: 587,<br \/>\n        secure: false,<br \/>\n        auth: {<br \/>\n            user: process.env.USER_EMAIL,<br \/>\n            pass: process.env.USER_PASS,<br \/>\n        },<br \/>\n    });<br \/>\n    const mailOptions = {<br \/>\n        from: &#8216;fromEmail@t2s.group&#8217;,<br \/>\n        to: email,<br \/>\n        subject: &#8221;,<br \/>\n        html: `<\/p>\n<p>            test<\/p>\n<p>            ${message}, N\u00b0 ${numero}, ${intitul\u00e9}.<\/p>\n<p>            V\u00e9rifiez ici\ud83d\udc7b<\/p>\n<p>        `,<br \/>\n    };<br \/>\n    transporter.sendMail(mailOptions, function (error, info) {<br \/>\n        if (error) {<br \/>\n            console.log(error);<br \/>\n        } else {<br \/>\n            console.log(&#8216;Email sent:&#8217; + info.response);<br \/>\n        }<br \/>\n    });<br \/>\n}<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u062a\u0648\u0636\u06cc\u062d:<\/p>\n<p>\u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u062d\u0645\u0644 \u0648 \u0646\u0642\u0644:<\/p>\n<p>Nodemailer \u0631\u0627 \u0628\u0631\u0627\u06cc \u0627\u0631\u0633\u0627\u0644 \u0627\u06cc\u0645\u06cc\u0644 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Office365 SMTP \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0645\u06cc \u06a9\u0646\u062f.\u06af\u0632\u06cc\u0646\u0647 \u0647\u0627\u06cc \u0627\u06cc\u0645\u06cc\u0644:<\/p>\n<p>\u0627\u06cc\u0645\u06cc\u0644 \u0631\u0627 \u0628\u0627 \u0645\u0648\u0636\u0648\u0639 \u0648 \u0645\u062a\u0646 HTML \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc \u06a9\u0646\u062f\u060c \u0627\u0632 \u062c\u0645\u0644\u0647 \u067e\u06cc\u0648\u0646\u062f\u0647\u0627\u06cc\u06cc \u0628\u0627 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u062c\u0633\u062a\u062c\u0648\u06cc \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631.\u0631\u0645\u0632\u06af\u0630\u0627\u0631\u06cc URL:<\/p>\n<p>\u0627\u0632 encodeURIcomponent \u0628\u0631\u0627\u06cc \u0631\u0645\u0632\u06af\u0630\u0627\u0631\u06cc \u0627\u06cc\u0645\u0646 URL \u0628\u0631\u0627\u06cc \u062f\u0631\u062c \u062f\u0631 \u067e\u06cc\u0648\u0646\u062f\u0647\u0627\u06cc \u0627\u06cc\u0645\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u062f.\u0627\u0631\u0633\u0627\u0644 \u0646\u0627\u0645\u0647:<\/p>\n<p>\u0627\u06cc\u0645\u06cc\u0644 \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 transporter.sendMail \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc \u06a9\u0646\u062f.`@post(&#39;\u0648\u0631\u0648\u062f \u0628\u0647 \u0633\u06cc\u0633\u062a\u0645&#39;)\u0648\u0631\u0648\u062f \u063a\u06cc\u0631 \u0647\u0645\u06af\u0627\u0645 (\u0634\u0646\u0627\u0633\u0647 @Body(&#39;id&#39;): \u0631\u0634\u062a\u0647\u060c\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 @Body(&#39;password&#39;): \u0631\u0634\u062a\u0647\u060c@Body(&#39;company&#39;) \u0634\u0631\u06a9\u062a: \u0634\u0631\u06a9\u062a\u060c@Body(&#39;redirect&#39;) redirect: string,@Res({ passthrough: true }) \u067e\u0627\u0633\u062e: \u067e\u0627\u0633\u062e\u060c) {const user = await this.collaborateursService.find({\u06a9\u062c\u0627: { nomtechnicien: id }\u060c\u0631\u0648\u0627\u0628\u0637: [&#8216;companies&#8217;,&#8217;roles.role&#8217;,&#8217;roles.company&#8217;,&#8217;groups&#8217;,&#8217;groupe&#8217;,]\u060c})\u061b<\/p>\n<p>\u0627\u06af\u0631 (! \u06a9\u0627\u0631\u0628\u0631) {\u067e\u0631\u062a\u0627\u0628 \u062c\u062f\u06cc\u062f BadRequestException(&#39;\u0645\u0639\u062a\u0628\u0631 \u0646\u0627\u0645\u0639\u062a\u0628\u0631&#39;);}if (!( \u0645\u0646\u062a\u0638\u0631 bcrypt.compare(password, user.password))) {\u067e\u0631\u062a\u0627\u0628 \u062c\u062f\u06cc\u062f BadRequestException(&#39;\u0645\u0639\u062a\u0628\u0631 \u0646\u0627\u0645\u0639\u062a\u0628\u0631&#39;);}if (!user.lastconnectedcompany) {await this.collaborateursService.lastConnectedCompany(user.id\u060c user.companies[0])}<\/p>\n<p>const jwt = await this.jwtService.signAsync({\u0634\u0646\u0627\u0633\u0647: user.id\u060c\u0646\u0627\u0645: user.nomtechnicien\u060clastconnectedcompany: user.lastconnectedcompany || user.companies[0].\u0646\u0627\u0645\u060crolesByCompanies: user.rolesByCompanies\u060c\u06af\u0631\u0648\u0647 \u0647\u0627: user.groups!\u060c\u0634\u0631\u06a9\u062a: user.companies,companyId: user.companies.filter((\u0634\u0631\u06a9\u062a) =>user.lastconnectedcompany? company.name == user.lastconnectedcompany: company.name == user.companies[0].\u0646\u0627\u0645\u060c)[0].identifantBc\u060c})\u061banswer.cookie(&#39;jwt&#39;, jwt, { httpOnly: true });\u062d\u0630\u0641 user.password;\u0628\u0627\u0632\u06af\u0634\u062a {\u067e\u06cc\u0627\u0645: &#8220;\u0645\u0648\u0641\u0642\u06cc\u062a&#8221;\u060c\u06a9\u0627\u0631\u0628\u0631\u060c\u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631: \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 ? \u0631\u0645\u0632\u06af\u0634\u0627\u06cc\u06ccURIcomponent(redirect): null\u060c};}`\u06cc\u0627\u0641\u062a\u0646 \u06a9\u0627\u0631\u0628\u0631:<\/p>\n<p>\u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u0628\u0627 \u0634\u0646\u0627\u0633\u0647 \u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0627\u0639\u062a\u0628\u0627\u0631 \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u0645\u06cc \u06a9\u0646\u062f.\u062a\u0648\u0644\u06cc\u062f JWT:<\/p>\n<p>\u06cc\u06a9 \u062a\u0648\u06a9\u0646 JWT \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0622\u0646 \u0631\u0627 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u06cc\u06a9 \u06a9\u0648\u06a9\u06cc \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc \u06a9\u0646\u062f.\u0631\u0645\u0632\u06af\u0634\u0627\u06cc\u06cc URL \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631:<\/p>\n<p>\u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 \u0631\u0627 \u0627\u0632 \u0628\u062f\u0646\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0631\u0645\u0632\u06af\u0634\u0627\u06cc\u06cc \u0645\u06cc \u06a9\u0646\u062f.\u067e\u0627\u0633\u062e \u0628\u0627\u0632\u06af\u0634\u062a:<\/p>\n<p>\u06cc\u06a9 \u067e\u06cc\u0627\u0645 \u0645\u0648\u0641\u0642\u06cc\u062a \u0622\u0645\u06cc\u0632 \u0648 URL \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 \u0631\u0645\u0632\u06af\u0634\u0627\u06cc\u06cc \u0634\u062f\u0647 \u0631\u0627 \u0628\u0631\u0645\u06cc \u06af\u0631\u062f\u0627\u0646\u062f.\u0641\u0631\u0627\u0646\u062a \u0627\u0646\u062f \u0627\u0631\u0633\u0627\u0644`const submit = async () => {setIsLoading(true);\u0627\u0645\u062a\u062d\u0627\u0646 \u06a9\u0646 {const res = await empLogin({ id: id, password: pass, redirect: redirectUrl });console.log(res);if (res.message === &#8220;\u0645\u0648\u0641\u0642\u06cc\u062a&#8221;) {\u0627\u0631\u0633\u0627\u0644 (\u0648\u0631\u0648\u062f \u0628\u0647 \u0633\u06cc\u0633\u062a\u0645 ());[      \/\/ Navigate to the redirect URL provided in the response](<\/p>\n[- url](<\/p>\n<p>url ) ) navigate(res.redirect); } } catch (\u062e\u0637\u0627) { console.log(error); setError(true); } \u062f\u0631 \u0646\u0647\u0627\u06cc\u062a { setIsLoading(false); } } ` \u062b\u0628\u062a \u0648\u0631\u0648\u062f:<\/p>\n<p>\u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0648\u0631\u0648\u062f \u0628\u0627 \u0634\u0646\u0627\u0633\u0647\u060c \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0648 URL \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 \u0631\u0627 \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc \u06a9\u0646\u062f.\u067e\u0627\u0633\u062e \u062f\u0633\u062a\u0647:<\/p>\n<p>\u0627\u06af\u0631 \u0648\u0631\u0648\u062f \u0645\u0648\u0641\u0642\u06cc\u062a \u0622\u0645\u06cc\u0632 \u0628\u0648\u062f\u060c \u0628\u0647 URL \u0627\u0631\u0627\u0626\u0647 \u0634\u062f\u0647 \u062f\u0631 \u0642\u0633\u0645\u062a \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 \u067e\u0627\u0633\u062e \u0647\u062f\u0627\u06cc\u062a \u0645\u06cc \u0634\u0648\u062f.\u0631\u0633\u06cc\u062f\u06af\u06cc \u0628\u0647 \u062e\u0637\u0627:<\/p>\n<p>\u0647\u0631 \u06af\u0648\u0646\u0647 \u062e\u0637\u0627 \u0631\u0627 \u062f\u0631 \u0637\u0648\u0644 \u0641\u0631\u0622\u06cc\u0646\u062f \u062f\u0631\u06cc\u0627\u0641\u062a \u0648 \u062b\u0628\u062a \u0645\u06cc \u06a9\u0646\u062f.\u0627\u06cc\u0646 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u062a\u0636\u0645\u06cc\u0646 \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 \u0648\u0642\u062a\u06cc \u06a9\u0627\u0631\u0628\u0631 \u0648\u0627\u0631\u062f \u0633\u06cc\u0633\u062a\u0645 \u0645\u06cc \u0634\u0648\u062f\u060c \u0628\u0647 \u0637\u0648\u0631 \u062e\u0648\u062f\u06a9\u0627\u0631 \u0628\u0647 URL \u0645\u0634\u062e\u0635 \u0634\u062f\u0647 \u062f\u0631 \u067e\u06cc\u0648\u0646\u062f \u0627\u06cc\u0645\u06cc\u0644 \u0647\u062f\u0627\u06cc\u062a \u0645\u06cc \u0634\u0648\u062f.<\/p>\n<div data-article-id=\"1994890\" id=\"article-body\">\n<p>\u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0628\u0647 \u062a\u0641\u06a9\u06cc\u06a9 \u06a9\u062f \u0648 \u0646\u062d\u0648\u0647 \u06a9\u0627\u0631 \u0622\u0646 \u0645\u06cc \u067e\u0631\u062f\u0627\u0632\u06cc\u0645:<\/p>\n<p>\u0639\u0645\u0644\u06a9\u0631\u062f \u0627\u0631\u0633\u0627\u0644 \u0627\u06cc\u0645\u06cc\u0644<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>async sendingEmail(email, ndfCollabName, message, numero, intitul\u00e9, Url) {\n    const transporter = nodemailer.createTransport({\n        host: 'smtp.office365.com',\n        port: 587,\n        secure: false,\n        auth: {\n            user: process.env.USER_EMAIL,\n            pass: process.env.USER_PASS,\n        },\n    });\n    const mailOptions = {\n        from: 'fromEmail@t2s.group',\n        to: email,\n        subject: '',\n        html: `\n        \n        \n        \n            <meta charset=\"UTF-8\"\/>\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\/>\n            <title>test<\/title>\n            \n        \n        \n            \n            <div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter-rtl ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u0641\u0647\u0631\u0633\u062a \u0645\u0637\u0627\u0644\u0628<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"\u062a\u063a\u06cc\u06cc\u0631 \u0648\u0636\u0639\u06cc\u062a \u0641\u0647\u0631\u0633\u062a \u0645\u0637\u0627\u0644\u0628\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/nabfollower.com\/blog\/how-can-i-automatically-navigate-to-a-page-specified-in-a-link-within-an-email-when-the-user-logs-in-automatically-ka8\/#message_N%C2%B0_numero_intitule\" >${message}, N\u00b0 ${numero}, ${intitul\u00e9}.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/nabfollower.com\/blog\/how-can-i-automatically-navigate-to-a-page-specified-in-a-link-within-an-email-when-the-user-logs-in-automatically-ka8\/#Verifiez_ici%F0%9F%91%BB\" >V\u00e9rifiez ici\ud83d\udc7b<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"message_N%C2%B0_numero_intitule\"><\/span>${message}, N\u00b0 ${numero}, ${intitul\u00e9}.<span class=\"ez-toc-section-end\"><\/span><\/h2>\n            \n            <h2><span class=\"ez-toc-section\" id=\"Verifiez_ici%F0%9F%91%BB\"><\/span>V\u00e9rifiez ici\ud83d\udc7b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n        \n        \n        `,\n    };\n    transporter.sendMail(mailOptions, function (error, info) {\n        if (error) {\n            console.log(error);\n        } else {\n            console.log('Email sent:' + info.response);\n        }\n    });\n}\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u062a\u0648\u0636\u06cc\u062d:<\/p>\n<p>\u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u062d\u0645\u0644 \u0648 \u0646\u0642\u0644:<\/p>\n<p>Nodemailer \u0631\u0627 \u0628\u0631\u0627\u06cc \u0627\u0631\u0633\u0627\u0644 \u0627\u06cc\u0645\u06cc\u0644 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Office365 SMTP \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0645\u06cc \u06a9\u0646\u062f.<br \/>\u06af\u0632\u06cc\u0646\u0647 \u0647\u0627\u06cc \u0627\u06cc\u0645\u06cc\u0644:<\/p>\n<p>\u0627\u06cc\u0645\u06cc\u0644 \u0631\u0627 \u0628\u0627 \u0645\u0648\u0636\u0648\u0639 \u0648 \u0645\u062a\u0646 HTML \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc \u06a9\u0646\u062f\u060c \u0627\u0632 \u062c\u0645\u0644\u0647 \u067e\u06cc\u0648\u0646\u062f\u0647\u0627\u06cc\u06cc \u0628\u0627 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u062c\u0633\u062a\u062c\u0648\u06cc \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631.<br \/>\u0631\u0645\u0632\u06af\u0630\u0627\u0631\u06cc URL:<\/p>\n<p>\u0627\u0632 encodeURIcomponent \u0628\u0631\u0627\u06cc \u0631\u0645\u0632\u06af\u0630\u0627\u0631\u06cc \u0627\u06cc\u0645\u0646 URL \u0628\u0631\u0627\u06cc \u062f\u0631\u062c \u062f\u0631 \u067e\u06cc\u0648\u0646\u062f\u0647\u0627\u06cc \u0627\u06cc\u0645\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u062f.<br \/>\u0627\u0631\u0633\u0627\u0644 \u0646\u0627\u0645\u0647:<\/p>\n<p>\u0627\u06cc\u0645\u06cc\u0644 \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 transporter.sendMail \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc \u06a9\u0646\u062f.<br \/>`@post(&#39;\u0648\u0631\u0648\u062f \u0628\u0647 \u0633\u06cc\u0633\u062a\u0645&#39;)<br \/>\u0648\u0631\u0648\u062f \u063a\u06cc\u0631 \u0647\u0645\u06af\u0627\u0645 (<br \/>\u0634\u0646\u0627\u0633\u0647 @Body(&#39;id&#39;): \u0631\u0634\u062a\u0647\u060c<br \/>\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 @Body(&#39;password&#39;): \u0631\u0634\u062a\u0647\u060c<br \/>@Body(&#39;company&#39;) \u0634\u0631\u06a9\u062a: \u0634\u0631\u06a9\u062a\u060c<br \/>@Body(&#39;redirect&#39;) redirect: string,<br \/>@Res({ passthrough: true }) \u067e\u0627\u0633\u062e: \u067e\u0627\u0633\u062e\u060c<br \/>) {<br \/>const user = await this.collaborateursService.find({<br \/>\u06a9\u062c\u0627: { nomtechnicien: id }\u060c<br \/>\u0631\u0648\u0627\u0628\u0637: [<br \/>&#8216;companies&#8217;,<br \/>&#8216;roles.role&#8217;,<br \/>&#8216;roles.company&#8217;,<br \/>&#8216;groups&#8217;,<br \/>&#8216;groupe&#8217;,<br \/>]\u060c<br \/>})\u061b<\/p>\n<p>\u0627\u06af\u0631 (! \u06a9\u0627\u0631\u0628\u0631) {<br \/>\u067e\u0631\u062a\u0627\u0628 \u062c\u062f\u06cc\u062f BadRequestException(&#39;\u0645\u0639\u062a\u0628\u0631 \u0646\u0627\u0645\u0639\u062a\u0628\u0631&#39;);<br \/>}<br \/>if (!( \u0645\u0646\u062a\u0638\u0631 bcrypt.compare(password, user.password))) {<br \/>\u067e\u0631\u062a\u0627\u0628 \u062c\u062f\u06cc\u062f BadRequestException(&#39;\u0645\u0639\u062a\u0628\u0631 \u0646\u0627\u0645\u0639\u062a\u0628\u0631&#39;);<br \/>}<br \/>if (!user.lastconnectedcompany) {<br \/>await this.collaborateursService.lastConnectedCompany(user.id\u060c user.companies[0])<br \/>}<\/p>\n<p>const jwt = await this.jwtService.signAsync({<br \/>\u0634\u0646\u0627\u0633\u0647: user.id\u060c<br \/>\u0646\u0627\u0645: user.nomtechnicien\u060c<br \/>lastconnectedcompany: user.lastconnectedcompany || user.companies[0].\u0646\u0627\u0645\u060c<br \/>rolesByCompanies: user.rolesByCompanies\u060c<br \/>\u06af\u0631\u0648\u0647 \u0647\u0627: user.groups!\u060c<br \/>\u0634\u0631\u06a9\u062a: user.companies,<br \/>companyId: user.companies.filter((\u0634\u0631\u06a9\u062a) =><br \/>user.lastconnectedcompany<br \/>? company.name == user.lastconnectedcompany<br \/>: company.name == user.companies[0].\u0646\u0627\u0645\u060c<br \/>)[0].identifantBc\u060c<br \/>})\u061b<br \/>answer.cookie(&#39;jwt&#39;, jwt, { httpOnly: true });<br \/>\u062d\u0630\u0641 user.password;<br \/>\u0628\u0627\u0632\u06af\u0634\u062a {<br \/>\u067e\u06cc\u0627\u0645: &#8220;\u0645\u0648\u0641\u0642\u06cc\u062a&#8221;\u060c<br \/>\u06a9\u0627\u0631\u0628\u0631\u060c<br \/>\u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631: \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 ? \u0631\u0645\u0632\u06af\u0634\u0627\u06cc\u06ccURIcomponent(redirect): null\u060c<br \/>};<br \/>}<br \/>`<br \/>\u06cc\u0627\u0641\u062a\u0646 \u06a9\u0627\u0631\u0628\u0631:<\/p>\n<p>\u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u0628\u0627 \u0634\u0646\u0627\u0633\u0647 \u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0627\u0639\u062a\u0628\u0627\u0631 \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u0645\u06cc \u06a9\u0646\u062f.<br \/>\u062a\u0648\u0644\u06cc\u062f JWT:<\/p>\n<p>\u06cc\u06a9 \u062a\u0648\u06a9\u0646 JWT \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0622\u0646 \u0631\u0627 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u06cc\u06a9 \u06a9\u0648\u06a9\u06cc \u062a\u0646\u0638\u06cc\u0645 \u0645\u06cc \u06a9\u0646\u062f.<br \/>\u0631\u0645\u0632\u06af\u0634\u0627\u06cc\u06cc URL \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631:<\/p>\n<p>\u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 \u0631\u0627 \u0627\u0632 \u0628\u062f\u0646\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0631\u0645\u0632\u06af\u0634\u0627\u06cc\u06cc \u0645\u06cc \u06a9\u0646\u062f.<br \/>\u067e\u0627\u0633\u062e \u0628\u0627\u0632\u06af\u0634\u062a:<\/p>\n<p>\u06cc\u06a9 \u067e\u06cc\u0627\u0645 \u0645\u0648\u0641\u0642\u06cc\u062a \u0622\u0645\u06cc\u0632 \u0648 URL \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 \u0631\u0645\u0632\u06af\u0634\u0627\u06cc\u06cc \u0634\u062f\u0647 \u0631\u0627 \u0628\u0631\u0645\u06cc \u06af\u0631\u062f\u0627\u0646\u062f.<br \/>\u0641\u0631\u0627\u0646\u062a \u0627\u0646\u062f \u0627\u0631\u0633\u0627\u0644<br \/>`const submit = async () => {<br \/>setIsLoading(true);<br \/>\u0627\u0645\u062a\u062d\u0627\u0646 \u06a9\u0646 {<br \/>const res = await empLogin({ id: id, password: pass, redirect: redirectUrl });<br \/>console.log(res);<br \/>if (res.message === &#8220;\u0645\u0648\u0641\u0642\u06cc\u062a&#8221;) {<br \/>\u0627\u0631\u0633\u0627\u0644 (\u0648\u0631\u0648\u062f \u0628\u0647 \u0633\u06cc\u0633\u062a\u0645 ());<br \/>[      \/\/ Navigate to the redirect URL provided in the response<br \/>](<\/p>\n[- url](<\/p>\n<ol>\n<li>url ) ) navigate(res.redirect); } } catch (\u062e\u0637\u0627) { console.log(error); setError(true); } \u062f\u0631 \u0646\u0647\u0627\u06cc\u062a { setIsLoading(false); } } ` \u062b\u0628\u062a \u0648\u0631\u0648\u062f:<\/li>\n<\/ol>\n<p>\u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0648\u0631\u0648\u062f \u0628\u0627 \u0634\u0646\u0627\u0633\u0647\u060c \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0648 URL \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 \u0631\u0627 \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc \u06a9\u0646\u062f.<br \/>\u067e\u0627\u0633\u062e \u062f\u0633\u062a\u0647:<\/p>\n<p>\u0627\u06af\u0631 \u0648\u0631\u0648\u062f \u0645\u0648\u0641\u0642\u06cc\u062a \u0622\u0645\u06cc\u0632 \u0628\u0648\u062f\u060c \u0628\u0647 URL \u0627\u0631\u0627\u0626\u0647 \u0634\u062f\u0647 \u062f\u0631 \u0642\u0633\u0645\u062a \u062a\u063a\u06cc\u06cc\u0631 \u0645\u0633\u06cc\u0631 \u067e\u0627\u0633\u062e \u0647\u062f\u0627\u06cc\u062a \u0645\u06cc \u0634\u0648\u062f.<br \/>\u0631\u0633\u06cc\u062f\u06af\u06cc \u0628\u0647 \u062e\u0637\u0627:<\/p>\n<p>\u0647\u0631 \u06af\u0648\u0646\u0647 \u062e\u0637\u0627 \u0631\u0627 \u062f\u0631 \u0637\u0648\u0644 \u0641\u0631\u0622\u06cc\u0646\u062f \u062f\u0631\u06cc\u0627\u0641\u062a \u0648 \u062b\u0628\u062a \u0645\u06cc \u06a9\u0646\u062f.<br \/>\u0627\u06cc\u0646 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u062a\u0636\u0645\u06cc\u0646 \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 \u0648\u0642\u062a\u06cc \u06a9\u0627\u0631\u0628\u0631 \u0648\u0627\u0631\u062f \u0633\u06cc\u0633\u062a\u0645 \u0645\u06cc \u0634\u0648\u062f\u060c \u0628\u0647 \u0637\u0648\u0631 \u062e\u0648\u062f\u06a9\u0627\u0631 \u0628\u0647 URL \u0645\u0634\u062e\u0635 \u0634\u062f\u0647 \u062f\u0631 \u067e\u06cc\u0648\u0646\u062f \u0627\u06cc\u0645\u06cc\u0644 \u0647\u062f\u0627\u06cc\u062a \u0645\u06cc \u0634\u0648\u062f.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summarize this content to 400 words in Persian Lang \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0628\u0647 \u062a\u0641\u06a9\u06cc\u06a9 \u06a9\u062f \u0648 \u0646\u062d\u0648\u0647 \u06a9\u0627\u0631 \u0622\u0646 \u0645\u06cc \u067e\u0631\u062f\u0627\u0632\u06cc\u0645: \u0639\u0645\u0644\u06a9\u0631\u062f \u0627\u0631\u0633\u0627\u0644 \u0627\u06cc\u0645\u06cc\u0644 async sendingEmail(email, ndfCollabName, message, numero, intitul\u00e9, Url) { const transporter = nodemailer.createTransport({ host: &#8216;smtp.office365.com&#8217;, port: 587, secure: false, auth: { user: process.env.USER_EMAIL, pass: process.env.USER_PASS, }, }); const mailOptions = { from: &#8216;fromEmail@t2s.group&#8217;, &hellip;<\/p>\n","protected":false},"author":2,"featured_media":76288,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[339],"tags":[],"class_list":["post-76287","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/76287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/comments?post=76287"}],"version-history":[{"count":0,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/76287\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media\/76288"}],"wp:attachment":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media?parent=76287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/categories?post=76287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/tags?post=76287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}