The Simple JWT Login MailPoet plugin is an add-on for the Simple-Jwt-Login plugin. It allows you to seamlessly log users into your WordPress site using a JWT generated from MailPoet newsletters.
- MailPoet plugin ( Version 3 )
- Simple-JWT-Login plugin
This add-on works by embedding a simple shortcode within your MailPoet email templates. The shortcode generates a login link that automatically authenticates users in WordPress via JWT when clicked.
[custom:simple-jwt-login]
This shortcode will generate a link, with the text "Login".
Available shortcode parameters:
text
: Text displayed on the login link (e.g., "Click to Login").class
: Add a custom CSS class to the link.style
: Add custom inline CSS to the link.validity
: Duration (in seconds) for which the JWT is valid (e.g.,3600
for 1 hour).authCode
: The Auth Code required for login. You can find this in Simple-JWT-Login -> Auth Codes.redirectUrl
: This URL will overwrite the SimpleJWTLogin settings, and it will specify where users will be redirected after autologin.isUrl
: If this parameter is set, the shortcode will return the auto-login URL instead of rendering the login link.
Full short code example:
[custom:simple-jwt-login text="Login" class="myClassName" style="color:red;" validity="604800" authCode="1"]
This example will generate a red link, with the text "Login".
You can also customize the shortcode to just return the URL.
[custom:simple-jwt-login text="Login" validity="604800" isUrl="on"]
Here's how you install and activate the Simple-JWT-Login MailPoet plugin:
- Download the Simple-JWT-login-MailPoet plugin ZIP file.
- Upload the ZIP file in your WordPress
- Activate the plugin from the "Plugins" menu in WordPress.
or
- Go to the 'Plugins' menu in WordPress and click Add New
- Search for 'Simple-JWT-Login-MailPoet' and select Install Now
- Activate the plugin when prompted
- After installation, go to the Simple JWT Login settings in your WordPress dashboard.
- In the MailPoet Integration tab, generate your shortcode.
- Copy the generated shortcode and paste it into your MailPoet email templates.
No, the Auth Code is optional. You can disable it in the Simple-JWT-Login -> Login Settings by setting Login requires Auth Code to No.
No, this plugin is compatible only with MailPoet 3, as MailPoet 2 is deprecated.
Yes, you can add as many shortcodes as you need within a single email template.