Blueshift Data Refactor - Magic Link
Table of contents
What is a Magic Link?
A Magic Link or secure login link is a unique link a customer will receive via email that will allow them to log in without entering a password.
The link and email can be generated one of two ways:
An API call to the magic link service
Clicking a button on the WordPress site, which generates a secure login link.
You can also link it to other actions such as a password reset. Once the user clicks on the Magic Link and is logged in, the user can be displayed a prompt to reset their password.
How is it used?
Below are a few use cases in which your business might utilize a Magic Link.
Use Case - Website Activity | Description |
---|---|
Allow customers secure access to paid content | If a customer reaches the login page and can’t remember their login information, they can be presented with the option to be sent a secure login link aka a Magic Link. This link is sent to the customers email address on file. When the customer clicks on the link, they will have access to all of their purchased content for a certain period of time. |
Allow customers to reset their password | Similar to the use case above, If a customer reaches the login page and can’t remember their login infomation, they can be presented with the option to reset their password. By selecting this option, the customer will be emailed a secure login link aka Magic Link. When the customer clicks on the link, they will be automatically logged in, but they will also be prompted to reset their password. |
Use Case - Transactional Activity | Description |
---|---|
Secure access to paid content/articles via email alerts | If a customer receives email alerts for a publications they have paid for, that email alert could contain a link to a specific article. By clicking on that link, the customer will automatically be logged in and redirected to that article. |
Allow new customers temporary access to new orders | When a customer places a new order (whether a subscription, product, or AMB item) they will receive a confirmation email with a temporary access link. This access is temporary because the purchase has not yet reached Advantage/finished processing. |
Allow existing customers access to new orders | Existing customers can use a link sent via a confirmation email to get access to newly purchased content that has not yet been processed in system. Once the purchase is fully processed, the customer will have access to this content using their standard login credentials. |
Website Activity
Website activity covers two main scenarios. Your website might offer two options when a customer forgets their password: Reset Password and Send Secure Login Link.
If a customer reaches the login page and can’t remember their login information, they can be presented with the option to reset their password. By selecting this option, the customer will be emailed a secure login link aka Magic Link. When the customer clicks on the link, they will be automatically logged in, but they will also be prompted to reset their password.
Similar to the above scenario, if a customer selects the option to be sent a secure login link aka a Magic Link, they will be emailed a secure link. When the customer clicks on the link, they will have access to all of their purchased content.
Workflow
Â
What you will need to do
Enable the Forgot Password Functionality and Customize the Language and Variables in WordPress
What does this do?
Enabling the forgot password functionality will allow you to customize the language and variables needed to send emails from Blueshift and display notifications on your website. Once enabling and saving, an event will be pushed Blueshift which will be referenced in event triggered campaigns.
Navigate to Middleware 2 in the left menu and click on the Settings tab
Locate the option Enable Secure Login/Magic Link For Password Reset and select On to enable. This will make the secure login link appear on your website
Scroll down and locate the Emails section.
Turn HTML Emails On and select Blueshift next to Send Email Through
Navigate to the Language Variables tab under Middleware 2. Customize the language for each of the variables.
These variables are used for both, forgot password and secure login requests from your website, so be sure to update all that will be used.
6. Next, create a template in Blueshift.
Create a Template in Blueshift
In Blueshift, create the email template by navigating to Creatives>Email
Click on + Template and select HTML Editor
Code and customize your template however you wish. For the body, however, you will need to enter the following.
{{html_body}}
This will use the event that has been pushed to Blueshift to insert the correct language variable and secure login link into your email based on the request coming from your website.
4. Next, create the campaign.
Create an Event Triggered Campaign in Blueshift
In Blueshift, navigate to campaigns
Click + Campaign and select Event Triggered
In the When Event Occurs field, select the event forgot_password
Attach the template created in the previous step
Once the campaign is scheduled and running, you’re good to go!
Transactional Activity
These scenarios will use endpoints and external fetches in Blueshift to allow you to send a variety of magic link functions.
What you will need to do
Enable the secure link (Magic Link) functionality on your website
Set Up External Fetch for Secure Link Login
Set up the Blueshift template
Enabling Secure Login Link and Magic Link Password Reset on your Website
What does this do?
Enabling the secure login/forgot password functionality will allow you to customize the language and variables needed to send emails from Blueshift and display notifications on your website.
Navigate to Middleware 2 in the left menu and click on the Settings tab
Locate the Emails section.
Turn HTML Emails On and select Blueshift next to Send Email Through
Navigate to the Language Variables tab under Middleware 2. Customize the language for each of the variables.
These variables are used for both, forgot password and secure login requests from your website, so be sure to update all that will be used.
6. Next, set up an External Fetch in Blueshift.
Setting Up External Fetch for Secure Link Login
What does this do?
The external fetch for the secure login link is going to use Middleware to return the customer number and limit access to active purchases the customer has made. This allows the customer to have access to the correct content once clicking on the secure login link.
In Blueshift, expand the Creatives menu and select External Fetches
Create a new external fetch and complete the following fields:
Â
Alias | Enter the name of the external fetch | |
HTTP Method | POST | |
Auth Header | token | |
Auth Token | MW Auth Token - this is required for all endpoints | |
URL (Endpoint) | Use Case | Endpoint  |
 | https://magiclink.14west.io/access/email | |
 | https://magiclink.14west.io/access/customernumber | |
 | ||
 | ||
 | ||
 | ||
 | ||
Body | Use the Request Body from the Swagger docs above to create the body of the external fetch. Example: |
Â
Setting up the Template in Blueshift
In Blueshift, create a new HTML template
Navigate to the Data tab and expand External Fetch and enter the one that was created in the last step. This will be listed under the alias name.
3. Next, you will need to add the external fetch to the content of your email via a link.
4. Navigate to the content tab. Add and edit one of the following links:
Â
Related FAQS
Related Content
Level up with a Masterclass
Â