Resolving Duplicated Base URL Issues in Approve/Decline Email Template Links

In some cases, approval or decline links within email notifications are generated with an incorrect URL, displaying a duplicated base domain. This issue prevents recipients from performing the intended approval or decline actions.

The root of the problem typically lies within the HTML code of the email templates configured in the Merchant panel. The incorrect template structure results in malformed URLs such as:

<a href="https://yourdomain.com/https://yourdomain.com/approve/123456">Approve</a>
<a href="https://yourdomain.com/https://yourdomain.com/decline/123456">Decline</a>

Notice the duplicated https://yourdomain.com/ in the href attribute, which causes the links to malfunction.

Locating the Faulty Email Template

Follow these steps to find the problematic template:

  1. Log in to the Merchant panel.
  2. Navigate to Configuration > Email Templates.
  3. Locate the template that contains the approve/decline link code.

Correcting the HTML Code

Switch the view from Wisiwig to Html and check your template for any hardcoded base URLs or concatenations that may result in duplication. The correct structure should ensure that the base URL is included only once - using a variable.

Incorrect Example:

<a href="https://yourdomain.com/{{approve_url}}">Approve</a>
<a href="https://yourdomain.com/{{decline_url}}">Decline</a>

If the {{approve_url}} or {{decline_url}} variables already include the full URL, prepending the base domain will cause duplication.

Correct Example:

<a href="{{approve_url}}">Approve</a>
<a href="{{decline_url}}">Decline</a>

Always verify whether your variables output the complete URL or just the path. Use only the necessary variable output to avoid duplicating the domain.

Final Steps

  • Save the updated email template.
  • Send a test email to confirm that the approve/decline links are now correctly formatted.

Example of Correct Link in Email:

By following these steps, you can ensure that your email notification links function as intended and provide a seamless user experience for recipients.

×