Dynamic email recipient problem

Home Forums Quform WordPress Dynamic email recipient problem

This topic is: not resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #15699
    kanodoe
    Participant

    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 formulario

    function 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.

    #15704
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #15748
    kanodoe
    Participant

    No, it didn’t make any difference, still not sending the message to the email.

    #15766
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #15780
    kanodoe
    Participant

    I’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

    #15896
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #16075
    kanodoe
    Participant

    I 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?

    #16249
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy