Auto Login From WHMCS Mails

From Deploymentcode
Jump to: navigation, search



This module does provide Auto-Login Links for your WHMCS mails. You can modify your existing links by just adding "&{$modautologin}" to authenticate the user automatically when he opens a link to an invoice or other pages. The authentication does work for every WHMCS page (custom module pages too) and the module has a lot of configurable options to meet every use purpose.
This can be useful for let your clients show the invoice directly or to increase the ticket feedback rate.

Buy Auto Login From Mails here


  • Clients are able to auto-login and open a specific site by clicking a link in the mail
  • Easy to use: Just add &{$modautologin} at the end of the the link.
  • Auto Login Link does work for every WHMCS page. Login to custom sites or module pages are also possible.
  • Auto Login Link can expire after a given time in hours
  • Limit the amount of page views. If the limit is reached, client need to login using his login details. Unlimited page views are also possible.
  • Option to expire the Auto Login Link if client changes his password or mail address
  • Clients can Opt-Out from Auto Login Links
  • "Client must Opt-In"-Mode: Clients must Opt-In to use Auto Login Links.
  • No template changes are necessary
  • Multilanguage


Installation of the module is completed within minutes.

Module Installation

1. Extract the module archive which you downloaded from the client area.
2. Upload the module to your WHMCS installation.
3. Go to the WHMCS Admin backend, click on "Setup" -> "Addon Modules" and activate the module.
4. Click on "Configure" and enter your license key.
5. Set the option which meets your requirements.
6. At "Access Control" select nothing.

If you did not defined an AutoAuth key in your WHMCS installation, then open the configuration.php file, which can be found at the root directory of WHMCS, and add following code at the end of your file:

$autoauthkey = "secure_string";

Replace "secure_string" with a random string.

If no key is defined, the auto login will not work. In that case an error message get logged into your Activity Log which tells you to add a Auto Auth key.

Description of Options

Auth Link is valid for: The Auto Login Link will expire after the given time in hours.
Maximum Page Views: You can limit the amount of page views. This option make it possible to only view the invoice and do not make other changes. Or to leave a ticket feedback, but do not permit to make more requests.
First URL Token Parameter: You can change the GET parameter name. With this option you can change the name of the URL. E.g.:
Second URL Token Parameter: Same as above
Expire all other links on click: When client opens a Auto Login Link, all other links for this client will expire.
Expire all links on password change: If the client changes his password, the Auto Login Links will expire.
Expire all links on mail change: If the client changes his mail address, the Auto Login Links will expire.
2 Factor Authentication: If the client uses 2 factor authentication, you can force him to login regulary. Otherwise, the 2 factor authentication is skipped.
Alert Boxes via Javascript: Description
Enable Opt-Out / Opt-In: Enable this option if you want to allow your clients to Opt-Out from Auto Login. The Auto Login Link will not log them in.
Opt-In / Opt-Out Field: To use the Opt-In / Opt-Out option, you need to create a new Tick Box custom field for clients. After that select the created field here.
Client must Opt-In: Choose this option if you want that clients must explicit enable the Auto Login Checkbox (your created custom field, which can be found at the client profile page).

Alert Messages

If an Auto Login Link is expired or if the maximum of page views has been reached, an error message will appear on the login page.
The error message get inserted using Javascript, thereforce, no template changes must be done.


It is possible to modify the output of the messages:
Javascript Mode: Edit the file template.php. The file can be found in the module directory.
Change the WHMCS Template File: You can copy & paste the following into your login.tpl file:

{if $ModAutologin_InvalidLink}
    <div class='panel panel-danger'>
        <div class='panel-heading'>
            <h3 class='panel-title'><strong>{$LANG.autologinfrommail_invalid_head}</strong></h3>
        <div class='panel-body text-center' style='font-size: 15px;'>{$LANG.autologinfrommail_invalid_body}

{if $ModAutologin_MaxViewsReached}
    <div class='panel panel-danger'>
        <div class='panel-heading'>
            <h3 class='panel-title'><strong>{$LANG.autologinfrommail_maxviews_head}</strong></h3>
        <div class='panel-body text-center' style='font-size: 15px;'>{$LANG.autologinfrommail_maxviews_body}

{if $ModAutologin_TwoFactorAuth}
    <div class='panel panel-danger'>
        <div class='panel-heading'>
            <h3 class='panel-title'><strong>{$LANG.autologinfrommail_twofactor_head}</strong></h3>
        <div class='panel-body text-center' style='font-size: 15px;'>{$LANG.autologinfrommail_twofactor_body}

Template changes are optional. If you do not want to display error messages, then disable the Javascript Mode and dont insert this code into your login.tpl file.

Language Files

Language files can be found in the module directory /lang. You can add new languages or modify existing languages.
The language file contains the error message strings.


Open "Setup" => "Email Template" and click on the mail where you want to add the Auto Login Link.
At the WHMCS Mail Editor you can add &{$modautologin} to existing links or create a new link with &{$modautologin} at the end.



Note: Replace & with ? if there are no parameters before the Auto Login Link (like demonstrated in the examples above).

Technical Details

Name Auto Login From Mails
Last Update 27.09.2017
Compatible WHMCS v7
Compatible PHP PHP 5, PHP 7
Licensing One license covers one WHMCS Installation
Code encryption ionCube
Orderlink Click


27.09.2017: Improvement: Module is now compatible with WHMCS v7.3 27.09.2017: Bugfix: Fix white page after saving module settings (happened only at a specific php configuration)