How to customize the message in the confirmation email

Last updated 26 November 2025
2 minutes read

Customize the message with the newly added WordPress filters

Customize the message that includes the booking confirmation token.

Starting from version 1.0.2, the Simple Bike Rental plugin sends the confirmation token email in HTML format, making the message more readable and professional.

Two WordPress filters have also been introduced to allow developers to customize the subject and content of the message.

In this guide, we’ll show you how to do it in just a few simple steps.

Changing the email subject

You can change the email subject using the simpbire_email_subject filter in your theme’s functions.php file (or in a custom plugin):

add_filter('simpbire_email_subject', 'custom_sbr_email_subject', 10, 2);
function custom_sbr_email_subject($subject, $nome) {
return "Confirm your bike rental, $nome!";
}

Editing the content of the email

The simpbire_email_message filter lets you customize the entire HTML message, including the confirmation link:

add_filter('simpbire_email_message', 'custom_sbr_email_message', 10, 3);
function custom_sbr_email_message($message, $nome, $link) {
    return "
    <p>Hi $nome,</p>
    <p>Thanks for booking your bike with us!</p>
    <p>Please confirm your rental by clicking the link below:</p>
    <p><a href=\"$link\">Click here to confirm</a></p>
    <p>Looking forward to seeing you!</p>
    ";
}

You can freely use HTML and insert images, logos, or a custom style.

Security and compatibility

The data provided by the plugin through filters ($name, $link, etc.) is already sanitized and safe to use.

However, if you use data from other sources, such as custom fields, user meta, or user input, in your personalized message, we recommend always applying WordPress security features.

  • esc_html() for plain text
  • esc_url() for URLs or images
  • esc_attr() for HTML attributes

Do you need help?

If you have any questions about how to apply these filters, you can contact us through the Contact page or start a thread in the support forum on WordPress.org.