How can we send different URL links in the Appointments+ reminder emails?

Hi guys,

We have a requirement to send out specific links in the reminder emails for the appointment's plus plugin. At the moment I can only see a way to send out a single reminder email for all appointments.

Is it possible to send out a conditional reminder for certain appointment services? e.g a mentorship appointment would have a mentorship url link to that page. Or a meditation session link would contain a meditation link for that session.

Is there a way to do this perhaps with custom email fields? For example could we make a url link into an email merge tag and insert that into the reminder email itself based upon certain conditions? Not sure if that's possible, just thinking aloud a bit really for a solution.

Any help you could give would be great!
Many thanks
Adam

  • Adam Czajczyk

    Hello Adam,

    I hope you're well today and thank you for your question!

    There's no "conditional e-mails" feature for Appointments+. There's a workaround I think, however it will require a custom job.

    As you probably know, you can assign a description page for each service provider or service (see image).

    This might be a dedicated page or any other page of your choice, for example one of those that you've mentioned.

    On the "Appointments" -> "Settings" -> "General" page you can edit e-mail's content (scroll down). If you enable the "Allow HTML email" add-on for Appointment+ you'll be able to send active links within the e-mail content.

    To enable this add-on go to your dashboard's

    "Appointments" -> "Settings" -> "Add-ons" page (see another image).

    You'll be able now to include a link in a message. The custom job here is to create and add a function that would read the value (an URL) of the "description page" from the database and then filter the message body to apply it to the (respectively) "SERVICE" and "SERVICE PROVIDER" variables.

    If you have any further questions on this, please ask. I'll be glad to help!

    Cheers,
    Adam

  • Adam Wallis

    Hi Adam,

    Thank you so much that's awesome that there is a workaround. I have implemented the settings you suggested but I don't know how to do this part...

    "The custom job here is to create and add a function that would read the value (an URL) of the "description page" from the database and then filter the message body to apply it to the (respectively) "SERVICE" and "SERVICE PROVIDER" variables."

    Could you explain please?

    Really great that we can find workaround solutions!
    Thanks

  • Adam Czajczyk

    Hey @Adam Wallis,

    I hope you're well today and thank you for you patience!

    It took some time but I've got a solution for you. I must state however that this is a "quick fix" or "workaround" that requires a plugin's code modification, thus it's really not recommended. Such fixes may cause unexpected plugin's behavior and also will be lost upon plugin's update.

    Of course you may note down the changes and re-enter them after the plugin's updated, unless the code's structure changes. That being said, here it is:

    1. You need to download main plugin file "appointments.php" from /wp-content/plugins/appointments/ folder
    2. Open the file with clean-text editor (UTF-8 support) such as Notepad++ or Sublime etc.
    3. Find this code (starting around line 4754):

    /**
    	 *	Replace placeholders with real values for email subject and content
    	 */
    	function _replace( $text, $user, $service, $worker, $datetime, $price, $deposit, $phone='', $note='', $address='', $email='', $city='' ) {

    4. Add the following code right below (in the next line), do not delete anything:

    $services_table_name = $wpdb->prefix . 'app_services';
    		$service_desc_page_id = $wpdb->get_row("SELECT * FROM $services_table_name WHERE name = '".$service."'");
    		$service_desc_page_url = get_permalink( $service_desc_page_id->page );

    5. Scroll down a bit until you find this code (this should be about line 4782):

    'SERVICE' => $this->escape_backreference($service),

    and change it to

    'SERVICE' => '<a href="' . $service_desc_page_url . '">' . $this->escape_backreference($service) . "</a>",

    6. Save the file and upload it back to /wp-content/plugins/appointments/ folder overriding the existing one.

    NOTE:
    - please remember to keep the backup of the original file in case something went wrong
    - this code is not "foolproof" meaning that I'm not sure how it will react if for example there's no description page assigned to a service or you'll change a configuration of Appointments+ siginificantly
    - changes will be lost upon plugin update

    Having said that, I tested this 'fix" and it works just fine adding a link to the defined description page for a booked service. Of course you need to enable HTML e-mails add-on first.

    Let me know if it works for you!

    Cheers,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.