Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Plugin no longer sending confirmation Emails WordPress

  • SOLVED

Hi All,

I have an issue with the Booked calendar plugin <codecanyon.net/item/booked-appointment-booking-for-wordpress/9466968/> where it is no longer sending confirmation Emails to applicants.

I have recently removed a function, written in the child theme [functions.php], to restore the default functionality but the confirmation emails are no longer being sent. All other Email notifications from the site are coming through OK.

I am looking for someone to help debug and solve the issue.

Many Thanks

Answers (4)

2016-03-22

Andrea P answers:

Well guys, I think that this thing of the PMs has gone a bit too far now.. -_-
especially 2510506, is ALWAYS writing a PM and his answers are only "please check pm".
looks like a spammer approach to me.

this website is meant to share solutions which then are here available for any other future visitor.
this is not a freelance job board where you have to hook potential clients (or victim..), and I think that this is not only an annoying spam/scam approach, but it's also damaging the community and the reputation/scope of this website.


going back to James issue,:

could you post here the function that you had in functions.php?
what was its purpose?
have the notifications stopped exactly after you took it off?

cheers


EdJames comments:

Hi Andrea,

Agree with you about the PM thing.

The following function was added so when the Applicant requests a booking they are added to a MailPoet mailing list. And, yes the Email confirmation stopped when I removed the functions.php. Note: I have changed the Email addresses below for privacy.

Many Thanks


<?php

function mycompany_booked_to_mailpoet() {

$mailpoet_list_id = array(

//the numeric values associated with the email addresses correspond
//to the current Mailpoet List ID.

'[email protected]' => '6', //cbd1
'[email protected]' => '7', //cbd2
'[email protected]' => '3', //cbd3
'[email protected]' => '5', //cbd4
'[email protected]' => '4', //cbd5
//dev only...
'[email protected]' => '1'

);

$customer_type = isset($_POST['customer_type']) ? $_POST['customer_type'] : null;
$calendar_id = isset($_POST['calendar_id']) ? $_POST['calendar_id'] : null;

$admin_email = booked_which_admin_to_send_email($calendar_id);
$list_id = (int) $mailpoet_list_id[$admin_email];

if ( $customer_type === 'guest' && ! empty($list_id) ) {

$guest_name = isset($_POST['guest_name']) ? $_POST['guest_name'] : null;
$guest_email = isset($_POST['guest_email']) ? $_POST['guest_email'] : null;
$guest_phone = isset($_POST['single-line-text-label---3069479___required']) ? $_POST['single-line-text-label---3069479___required'] : null;

/**
* Boxed plugin currently collects name as one input, so we will explode
* the value using a space-delimiter, taking the first value of the array
* as the first name and re-joining the remaining parts of the array to
* form that of an assume last name (possibly including middle name).
*
*/
$guest_name = explode(' ', $guest_name);
$first_name = array_shift($guest_name);
$last_name = implode(' ', $guest_name);

$user = array(
'email' => $guest_email,
'firstname' => $first_name,
'lastname' => $last_name
);

$user_data = array(
'user' => $user,
'user_list' => array(
'list_ids' => array($list_id)
)
);

$mailpoet_user = WYSIJA::get('user','helper');
$result = $mailpoet_user->addSubscriber($user_data);

}

}

add_action('booked_new_appointment_created', 'mycompany_booked_to_mailpoet', 99);


Andrea P comments:

Hello James,
thanks for your support, and thanks for the additional info.

I am a bit lost here, because that function is adding an action which shouldn't do anything to the rest of the plugin functionalities..
it is not manipulating something and then returning it to the plugin. it is adding an action which when is fired it adds the user to the list, acting on a separate level from everything else going on at that point within the plugin's functionalities..

have you tried to put it back and see if the confirmation is actually sent again?
I am wondering if maybe something else has happened and the problem is not with this missing function..


EdJames comments:

Hi Andrea,

I'm baffled too. :)

As you say, because the function is adding an action it's removal shouldn't affect the other plugin functionality ... but unfortunately it has. I have tried adding the functions.php again which re-instates the add-to-mailing list but it's no longer a requirement.

It looks like testing themes and re-activating the plugins one-by-one, might have to be the next step.


Andrea P comments:

sorry James, I haven't understood if when you add it back, it also restored the confirmation email sending?

if it hasn't, I guess that a good step could be to search for a conflict with another plugin.

if it sent the confirmation when you have put the function back again, I am wondering if that confirmation could be actually coming from the WYSIJA class, which seems part of the plugin/script which handles the subcription to the mailpoet list.

I mean that maybe the booking plugin doesn't send a confirmation email, and rather there was something that was sending a confirmation email after adding it to the list, and this confirmation is coded within the class handler that adds to mailpoet, rather than within the booking plugin..


EdJames comments:

Hi Andrea,

Just running some more tests. Will be back with you as soon as they are done.


EdJames comments:

Hi Andrea,

I found it. Unbeknownst to me, there was a change to the core. Sheesh..!

It's almost 2am here so I'll pick up contact with you tomorrow.

Thanks for your help and suggestions.


Andrea P comments:

Hello James!

I'm glad you found it!

what was the problem then? was a change to the plugin's core?

I guess it could have been that someone had blocked the default email confirmation from the plugin, in order to use a confirmation which was sent from the script which added the user to mailpoet list. am I guessing right? :)


EdJames comments:

Hi Andrea,

Yup, you guessed it. There was a change to the core plugin. Fortunately the latest Booked plugin has an export option so we can now bypass the whole MailPoet hook and run an exported CSV through it. For my part I'm now going to count my grey hairs and eat chocolate.

Thanks ever so much for all your suggestions.

2016-03-22

Shoeb mirza answers:

I'd like to help you in your issue.

Please PM me your credentials..

Thanks

2016-03-22

2510506 answers:

please check pm

2016-03-22

Rempty answers:

Hello EdJames
Check if the email have a "subject" or "text", because the plugin automatically disable emails with empty subject or text. wp-admin/admin.php?page=booked-settings#user-emails