Automated autologin link creation and emails¶
It is possible to send automatically generate autologin links to users that are registering to your website. This can be set up through the addon’s settings page:
The settings page is split in two sections:
The upper section allows configuring if autologin links are generated when a user registratis and whether an automated email is sent.
The lower part contains the email template for the email that is sent to users registering on your website if email sending is enabled in the upper section of the page.
User registration configuration¶
There are two options that control what to do when a new user registers. If the first option Create link when a new user registers is checked, the Wordpress website will generate a autlogin link automatically for each newly registered user.
If the second option Send newly created login link to user is also checked, the login link will automatically be send to the newly registered user using the email template in the lower part of the settings page. Not that both options have to be checked for emails to be sent. Also note that the email with the autologin link will be sent in addition to the regular registration email that Wordpress sends.
The email template¶
The emails template allows you to customize the contents of the email that is sent to users. Currently, there are a lot of limitations with the template syntax and supported features 1:
Only text emails are supported
No templating interaction with other email plugins
Template syntax does not use the Wordpress tag-syntax
The email template is a simple text box that contains text and tags that will be used to render the final email. An example of the sent email is rendered on the right side of the editor with all recognized tags substituted for example values. When a real user registers, these will be substituted by the corresponding values of the registering user.
Placeholders for values are formatted similar to how PHP formats variables:
$name
or $different_name("option")
. All values that look like these
will be substituted for other values. To escape strings that look like these
strings, use the $e("$escape")
operator (see table below).
The body of the email will be rendered and sent as is. It is possible to include a subject line by prefixing the first line with “Title:”. The rendered string that follows will be used as the email subject.
Template values¶
The following table includes all recognized value names that can be used in an email as placeholders for values:
Tag |
Description |
---|---|
|
Renders the name of the wordpress page Example values
|
|
The URL this wordpress website is availabe at Example values
|
|
The URL this wordpress website is availabe at including the user’s autologin-link Example values
|
|
Renders as userdata of the registering user. Example values
|
|
This tag allows to add a generated autologin link to arbitrary
subpaths of your website. The default behavior of However, if you include the path-argument, the user’s autologin link will be appended to that subpath. If the user uses that link to login to your website, he/she will be sent to the subpage you linked instead of the main page. Example values
|
|
Escapes the given value and renders it verbatim. Example values
|
Add user for administrators¶
In addition to the general settings of the addon that act on general user registrations, the adminstrator’s “Add User”-form also contains two new buttons that allow generating and sending of autologin links for newly registered users. They work the same as the general settings buttons but only apply to a single user registration. The email that is sent to the users registered though the admin interface is the same that is configured on the addon’s settings page.
Footnotes
- 1
The email features are very limited right now because they rely on custom email code. I decided that it is more efficient to handle email sending using other plugins. The goal will be to exchange the current email feature with a more robust implementation that relies on other plugins to send the actual emails. This is a planned after-release improvement.