Introduction
For WordPress sites offering gated content – whether it's exclusive downloads, premium videos, or restricted pages – email notifications are a critical touchpoint. These emails serve various purposes, from informing administrators about new access requests to delivering secure access links to approved users. However, generic, unbranded emails can undermine your site's professionalism and brand consistency.
To truly elevate your user experience and maintain a cohesive brand identity, customising these email templates is essential. While many plugins offer basic branding options, overriding their default templates provides unparalleled control over content, layout, and styling. This deep customisation ensures every communication aligns perfectly with your brand voice.
Plugins like WordPress Gatekeeper Pro streamline the entire gated content workflow, from access requests to secure content delivery. It also provides a robust email notification system. This guide will walk you through the process of overriding Gatekeeper Pro's email templates, giving you the power to tailor every aspect of your gated content communications.
Why Customise Your Gated Content Email Templates?
Beyond simply changing a logo, overriding email templates offers significant advantages for your WordPress site and its users.
Brand Consistency: Ensure every email, from admin notifications to user approvals, reflects your brand's colours, fonts, and tone of voice. This reinforces your identity and builds trust.
Enhanced Professionalism: Generic emails can feel impersonal and less credible. Custom templates project a polished, professional image, showing attention to detail.
Improved User Experience: Tailor the message to be clearer, more helpful, and directly relevant to the specific gated content. This can include specific instructions, follow-up information, or even personalised greetings.
Clearer Calls to Action: Design emails to guide users to their next step effectively, whether it's clicking an access link, providing more information, or engaging with other content on your site.
SEO and Analytics Opportunities: While not directly SEO, well-crafted emails can encourage users to return to your site, increasing engagement signals. Customisation also allows for the inclusion of tracking parameters if desired.
Admin Workflow Optimisation: Customise admin notifications to highlight critical information, making it quicker and easier for you to process access requests, potentially even adding internal notes or links.
Understanding WordPress Email Template Overrides
Most well-coded WordPress plugins, including Gatekeeper Pro, follow a standard practice for allowing template customisation without modifying the core plugin files. This method is crucial because directly editing plugin files means your changes will be lost every time the plugin updates.
The solution lies in the WordPress template hierarchy. When a plugin needs to load an email template (or any other template file), it first checks specific locations within your active theme (or child theme) for an overridden version of that file. If it finds one, it uses your custom version instead of its default. If not, it falls back to its own internal template.
This approach provides a safe, upgrade-proof way to modify templates. It typically involves creating a specific folder structure within your theme, copying the plugin's default template files into that new structure, and then editing the copies.
Identifying Gatekeeper Pro Email Templates
WordPress Gatekeeper Pro manages a comprehensive suite of email notifications to handle the entire gated content workflow. These emails are critical for both administrators and users, keeping everyone informed at each stage of the access request and approval process.
Gatekeeper Pro's email templates are typically located within the plugin's directory. Specifically, you'll find them under wp-content/plugins/gatekeeper-pro/templates/emails/. Inside this directory, you'll see various PHP files, each corresponding to a different email type.
Key email templates you might want to override include:
admin-notification.php: This email is sent to administrators when a new access request is submitted. It includes details of the requestor and provides direct links to approve or disapprove the request without needing to log into WordPress. (Related: Streamlining Your Workflow: Setting Up WordPress Admin Notifications for Content Access Requests)request-received.php: Sent to the user immediately after they submit an access request, confirming receipt of their submission.approved.php: The most crucial user-facing email, sent once an administrator approves a request. This email contains the secure, time-limited access link (token) to the gated content. (Related: Elevate Your Brand: How to Customise Access Approval Emails on Your WordPress Site)disapproved.php: Sent to the user if their access request is denied by an administrator.expiry-warning.php: An optional but highly useful email sent to users before their access token expires, reminding them and potentially prompting re-engagement. (Related: Expiry Warning Emails: Keeping Your WordPress Gated Content Users Informed)
Each of these templates contains placeholders (PHP variables) for dynamic content such as the user's name, content title, access links, and request details. Understanding which template corresponds to which notification is the first step in successful customisation.
Step-by-Step Guide: Overriding Gatekeeper Pro Email Templates
This tutorial assumes you have FTP/SFTP access or a file manager tool available through your hosting provider. Always perform these actions on a staging environment first, if possible, to avoid disrupting your live site.
Step 1: Access Your WordPress Installation
Using an FTP/SFTP client (like FileZilla) or your hosting control panel's file manager, connect to your WordPress site. You'll need to navigate to the root directory where your wp-content, wp-admin, and wp-includes folders are located.
Step 2: Locate Gatekeeper Pro's Default Email Templates
Navigate to the plugin's template directory:
/wp-content/plugins/gatekeeper-pro/templates/emails/Inside this folder, you'll see files like admin-notification.php, approved.php, etc. These are the default templates you'll be overriding.
Step 3: Create a Custom Template Directory in Your Theme
To safely override these templates, you need to create a corresponding directory structure within your active theme. It's highly recommended to use a child theme for this purpose. If you don't use a child theme, your changes will be overwritten when your main theme updates.
Navigate to your active theme's directory:
/wp-content/themes/your-child-theme-name/Inside your theme's directory, create a new folder named gatekeeper-pro. Then, inside gatekeeper-pro, create another folder named emails.
The final path should look like this:
/wp-content/themes/your-child-theme-name/gatekeeper-pro/emails/Step 4: Copy the Desired Template Files
From the Gatekeeper Pro plugin's default email templates directory (Step 2), copy the specific .php files you wish to customise. For example, if you want to modify the email sent to users upon approval, copy approved.php.
Paste these copied files into the custom directory you created in your theme (Step 3). For instance, approved.php would now be in:
/wp-content/themes/your-child-theme-name/gatekeeper-pro/emails/approved.phpRepeat this for every email template you intend to modify.
Step 5: Edit the Copied Template Files
Now you can open these copied files in a code editor to make your changes. These files are standard PHP and HTML, allowing for extensive customisation.
Understanding Template Variables
Within each template, Gatekeeper Pro makes various data available through PHP variables. These variables allow you to dynamically insert information relevant to the request or the gated content. Common variables include:
$user_name,$user_email: The requester's name and email address.$post_title: The title of the gated content.$access_url: The secure access link for the user (inapproved.php).$approve_url/$disapprove_url: One-click links for admin actions (inadmin-notification.php).$user_company,$user_phone,$user_location,$message: Optional form fields (inadmin-notification.php).$_config: An array of email settings (logo, button colours, footer text).$unlock_mode: Either'per_item'or'sitewide'— useful for conditional content.
Example Customisations:
You can modify anything from the email subject (if the template allows, often it's set via filters) to the entire HTML structure. Here are a few common customisations:
Adding a Custom Logo:
Locate a suitable place in the template (e.g., near the top) and add an <img> tag. You can use the logo URL from Gatekeeper Pro's settings or a custom image URL:
<img src="<?php echo esc_url( $_config['logo'] ); ?>" alt="Your Company Logo" style="max-width: 200px; height: auto; display: block; margin: 0 auto 20px;">Changing Body Text and Personalisation:
Update the paragraphs to match your brand's voice and insert dynamic data for personalisation. For example, in approved.php:
<p>Hello <?php echo esc_html( $user_name ); ?>,</p>
<p>Great news! Your request to access "<?php echo esc_html( $post_title ); ?>" has been approved. You can now access your exclusive content using the secure link below:</p>
<p><a href="<?php echo esc_url( $access_url ); ?>" style="display: inline-block; padding: 10px 20px; background-color: #0073AA; color: #ffffff; text-decoration: none; border-radius: 5px;">Access Your Content Now</a></p>Adding Custom Footer Information:
You can use the default footer text from Gatekeeper Pro settings or add your own custom footer:
<p style="text-align: center; font-size: 12px; color: #888;">© <?php echo date('Y'); ?> Your Company Name. All rights reserved.<br>
<?php echo ! empty( $_config['footer_text'] ) ? wp_kses_post( $_config['footer_text'] ) : ''; ?></p>Remember that emails are best styled with inline CSS for maximum compatibility across different email clients, as many clients strip out <style> tags in the header.
Step 6: Test Your Customised Emails
After making changes, it's crucial to test every modified email type:
Admin Notification: Submit a new access request on a gated post from a logged-out browser. Check your admin email inbox.
User Confirmation: Check the email inbox of the address used for the request.
User Approved/Disapproved: From the admin notification email (or the Gatekeeper Pro dashboard), approve or disapprove the request. Check the user's inbox again.
Expiry Warning: If you modified this, set a short token expiry time in Gatekeeper Pro settings (e.g., 5 minutes for testing) and wait for the email to trigger. Remember to revert this setting afterwards.
Check the emails on different devices and email clients (Gmail, Outlook, Apple Mail, etc.) to ensure consistent rendering.
Step 7: Refine and Iterate
Based on your testing, you may need to make further adjustments to your templates. Pay close attention to:
Layout on Mobile: Ensure the emails are responsive and easy to read on smaller screens.
Image Loading: Verify all images (especially logos) load correctly.
Link Functionality: Confirm all links, especially access tokens and admin approval links, are working.
Spam Filters: Avoid elements that might trigger spam filters, such as excessive capitalisation or too many images without text.
Advanced Customisation Techniques
Once you're comfortable with basic overrides, you can explore more advanced customisations within your email templates.
Conditional Logic for Dynamic Content
You can use PHP's conditional statements (if, else if, else) to display different content based on various factors. For example, you might want to show a specific message only if the gated content is a video, or if a particular custom field was submitted in the request form.
<?php if ( isset( $post_type ) && 'video' === $post_type ) : ?>
<p>Don't forget to check out our other training videos!</p>
<?php elseif ( isset( $user_company ) ) : ?>
<p>We appreciate your interest, <?php echo esc_html( $user_company ); ?>!</p>
<?php endif; ?>This allows for highly targeted and relevant email communications.
Integrating Custom Fields
If you've configured Gatekeeper Pro to use custom fields in your request form (either native fields or through Formidable Forms integration), you can access this data within your email templates. Gatekeeper Pro extracts each field into its own variable (e.g., $user_phone, $user_company, $user_location, $message).
<?php if ( isset( $user_phone ) && ! empty( $user_phone ) ) : ?>
<p>Phone: <?php echo esc_html( $user_phone ); ?></p>
<?php endif; ?>This is particularly useful for admin notification emails, providing all necessary information at a glance.
Internationalisation (i18n)
If your WordPress site supports multiple languages, your custom email templates should also be translatable. You can use standard WordPress internationalisation functions, but remember that the text domain needs to match your theme's text domain.
<p><?php echo esc_html__( 'Hello', 'your-child-theme-text-domain' ); ?> <?php echo esc_html( $user_name ); ?>,</p>Ensure your child theme has a .pot file and language files set up correctly for this to work.
Best Practices for Email Template Overrides
Following these best practices will ensure your email template customisations are robust, maintainable, and effective.
Always Use a Child Theme: This cannot be stressed enough. Any changes made directly to the parent theme or plugin files will be lost upon updates. A child theme protects your customisations.
Start with Small Changes: Don't try to rewrite an entire template at once. Make small, incremental changes and test thoroughly after each one.
Inline CSS for Styling: While modern email clients are improving, inline CSS remains the most reliable method for styling emails. Many clients strip out
<head>styles.Focus on Mobile Responsiveness: A significant portion of emails are opened on mobile devices. Design your templates with a mobile-first approach, using fluid layouts and appropriate font sizes.
Thorough Cross-Client Testing: Use services like Email on Acid or Litmus, or simply test on major email clients (Gmail, Outlook, Apple Mail) and devices, to ensure your emails render correctly everywhere.
Keep it Clean and Lightweight: Avoid overly complex HTML structures, excessive images, or large files, as these can slow loading times and trigger spam filters.
Version Control: If you're a developer, put your child theme (including the
gatekeeper-pro/emailsdirectory) under version control (e.g., Git). This allows you to track changes, revert if necessary, and collaborate effectively.Stay Updated: While overrides protect your changes, occasionally a plugin update might introduce new variables or structural changes to its default templates. Review the plugin's changelog to ensure your custom templates remain compatible.
Conclusion
Overriding email templates for gated content on your WordPress site provides an unparalleled level of control over your brand's digital communications. By following the step-by-step process outlined above, you can transform generic plugin emails into fully branded, professional, and engaging touchpoints for your users and administrators.
Leveraging the robust email system of a plugin like WordPress Gatekeeper Pro, combined with the power of template overrides, allows you to craft a seamless and trustworthy experience for anyone accessing your exclusive content. This attention to detail not only enhances your brand's perception but also optimises your workflow and improves user satisfaction.

