Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong user email notification when submit new "listing enquiry form" #398

Open
hercab opened this issue Sep 17, 2018 · 2 comments
Open

Wrong user email notification when submit new "listing enquiry form" #398

hercab opened this issue Sep 17, 2018 · 2 comments

Comments

@hercab
Copy link

hercab commented Sep 17, 2018

When a new listing enquiry form submit, an first email is sent to the user author of the property with the subject "Your inquiry has been sent!".

Expected Behavior

This mail should arrive to the mail of the guest who is making the request.

Current Behavior

Possible Solution

I think the problem is on line 1660 of the roomify_listing.module file
$to_account = user_load($type->uid);
if ($existing_account) {
$user_wrapper = entity_metadata_wrapper('user', $to_account);
$rules_state->currentArguments['user'] = $user_wrapper;
$rules_state->variables['user'] = $user_wrapper;
pet_action_send_pet('authenticated_user_booking_enquiry', NULL, $to_account, NULL, NULL, array(), $rules_state);
}

above the variable $to_account refers to the author and should be $account that refers to the user guest.

Steps to Reproduce from a clean installation of the latest release

Context (Environment)

@hercab hercab changed the title Wrong user email notification when sbmit new "listing enquiry form" Wrong user email notification when submit new "listing enquiry form" Sep 17, 2018
@nicolocaruso85
Copy link

Thank you for report. Now is fixed.

@hercab
Copy link
Author

hercab commented Sep 17, 2018

I think that the creator user of the property would be notificated always on new inquiry, so I suggest the next enhance.

$to_account = user_load($type->uid);
// Email author.
pet_action_send_pet('new_booking_enquiry', NULL, $to_account, NULL, NULL, array(), $rules_state);

if ($existing_account) {
$user_wrapper = entity_metadata_wrapper('user', $account);
$rules_state->currentArguments['user'] = $user_wrapper;
$rules_state->variables['user'] = $user_wrapper;
pet_action_send_pet('authenticated_user_booking_enquiry', NULL, $account, NULL, NULL, array(), $rules_state);
}
else {
// Email user with login instruction.
drupal_mail('roomify_conversations', 'register_no_approval_required', $email_address, NULL, array('account' => $account, 'roomify_conversation' => $conversation), variable_get('site_mail', ini_get('sendmail_from')));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants