diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-30 09:53:05 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-30 09:53:05 +0700 |
| commit | 0831511787b1cd2171d6dd1dd6c2c9da46b64d2e (patch) | |
| tree | 46b77b2098e35e1bdadba8d46aa2ebcbe61065e3 /indoteknik_custom | |
| parent | 6a87a12ca305d22db5532d1c645b67e9c5bf9747 (diff) | |
Add get activation token url on activation mail template
Diffstat (limited to 'indoteknik_custom')
| -rwxr-xr-x | indoteknik_custom/models/res_users.py | 6 | ||||
| -rw-r--r-- | indoteknik_custom/views/res_users.xml | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/indoteknik_custom/models/res_users.py b/indoteknik_custom/models/res_users.py index 02433deb..1e729550 100755 --- a/indoteknik_custom/models/res_users.py +++ b/indoteknik_custom/models/res_users.py @@ -27,4 +27,8 @@ class ResUsers(models.Model): for user in self: user._generate_otp() user._generate_activation_token() - template.send_mail(user.id, force_send=True)
\ No newline at end of file + template.send_mail(user.id, force_send=True) + + def get_activation_token_url(self): + base_url = self.env['ir.config_parameter'].get_param('site.base.url') + return f'{base_url}/register?activation=token&token={self.activation_token}' diff --git a/indoteknik_custom/views/res_users.xml b/indoteknik_custom/views/res_users.xml index cddd8253..fd2d47c8 100644 --- a/indoteknik_custom/views/res_users.xml +++ b/indoteknik_custom/views/res_users.xml @@ -37,7 +37,7 @@ <tr><td style="padding-bottom: 16px;">Kami senang Anda bergabung dengan Indoteknik.</td></tr> <tr><td style="padding-bottom: 16px;">Untuk mengaktifkan akun anda salin kode OTP berikut <strong>${object.otp_code}</strong>, lalu masukan pada kolom yang disediakan pada website Indoteknik.com</td></tr> - <tr><td style="padding-bottom: 16px;">Atau anda dapat klik tautan berikut: <a href="http://localhost:2100/register?activation=token&token=${object.activation_token}">Aktivasi akun</a></td></tr> + <tr><td style="padding-bottom: 16px;">Atau anda dapat klik tautan berikut: <a href="${object.get_activation_token_url() | safe}">Aktivasi akun</a></td></tr> <tr><td style="padding-bottom: 16px;">Jika anda mengalami kesulitan atau memiliki pertanyaan, hubungi tim dukungan kami melalui email <a href="mailto:sales@indoteknik.com">berikut</a></td></tr> <tr><td style="padding-bottom: 2px;">Hormat kami,</td></tr> |
