Home › Forums › Quform WordPress › Dynamic email recipient problem
- This topic has 7 replies, 2 voices, and was last updated 8 years, 9 months ago by Ally.
- AuthorPosts
- June 24, 2015 at 7:45 pm #15699kanodoeParticipant
Hi,
I’ve problem trying to make the email recipient dynamic getting the value from the URL.
I’ve created a hidden input named email, wich take the value from the URL (that’s work perfect), and created a function in functions.php based on another answers found in this website, but the email is not sended even the message says is successfully and the message is stored in the database.
This is the code used in functions.php
// Modificación del receptor del formulariofunction movicenter_modify_recipient(PHPMailer $mailer, $form, $attachments)
{
$emails = array_map('trim', explode(',', $_GET['email']));
$email = get_post_meta($postId, 'email', true);foreach ($emails as $email) {
if ($mailer->ValidateAddress($email)) {
$mailer->AddAddress($email);
}
}$mailer->SingleTo = true; // Hide recipient addresses from each other
return $mailer;
}
add_filter('iphorm_pre_send_notification_email_2', 'mytheme_modify_recipient', 10, 3);As you can see, the emails take and explode an array because it could be more than one email in the hidden input.
Please help!, regards.
June 25, 2015 at 10:15 am #15704AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 30, 2015 at 4:02 pm #15748kanodoeParticipantNo, it didn’t make any difference, still not sending the message to the email.
July 1, 2015 at 12:24 pm #15766AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 1, 2015 at 4:48 pm #15780kanodoeParticipantI’ve changed the mistake on the code that you pointed but nothing happens (I even check the number of the form id and change it from 2 to 1).
Actually the form don’t send anything, not even the confirmation email, maybe the problem is there?, how I can fix it?
Regards
July 6, 2015 at 11:50 am #15896AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 8, 2015 at 1:27 pm #16075kanodoeParticipantI make a debug in the development site and the debug.log take this:
[08-Jul-2015 12:24:20 UTC] PHP Notice: Undefined index: email in /Volumes/Kano HDD/Documentos/websites/movicenter/movicenter-dev/wp-content/themes/movicenter/functions.php on line 366
The line 366 contains:
$emails = array_map('trim', explode(',', $_POST['email']));
Anyways it don’t send the confirmation email, wich is strange because that email use the address in the form (that the user write) and is not sending anything.
Any tips?
July 13, 2015 at 10:36 am #16249AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.