Custom Autoreply problem

Home Forums Quform WordPress Custom Autoreply problem

This topic is: not resolved
  • This topic has 4 replies, 2 voices, and was last updated 9 years ago by Ally.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #15275
    bfagundes
    Participant

    Hey guys,

    I’m having a weird problem.

    When the user sends the form. I’m sending a custom auto reply email. But for some reason it is sending the form sent from the previous user. For example There’s 20 entries. The 21st guy sends his form. The email he receives has the data sent from the 20th guy.

    It could be some session problem? Because i’m also showing the data on a redirected page. I’m opening a session on both of them.


    session_start();

    #15276
    bfagundes
    Participant

    Since the page is showing the right data. I think that the email is being sent before actually redirecting to the other page and saving the data on the session. And maybe that’s why it’s sending the old data saved on the session. That doesn’t make much sense though.

    I’m attaching the email and the page php files. and here’s the code on the functions.php


    function mytheme_customize_autoreply($mailer, $form, $attachments){
    // Get the new email content from the file
    ob_start();
    include dirname(__FILE__) . '/email_processo_0012015.php';
    $content = ob_get_clean();

    // Set the email content
    $mailer->MsgHTML($content);

    // You must return the $mailer object
    return $mailer;
    }
    add_action('iphorm_pre_send_autoreply_email_2', 'mytheme_customize_autoreply', 10, 3);

    #15280
    bfagundes
    Participant

    So, I figured that the email was beeing sent before redirecting, so i changed this


    $process = $_SESSION['iphorm_2']['iphorm_2_15'];

    with this


    $process = $form->getValueHtml('iphorm_2_15');

    and now I’m getting the right information on the email, but how can I send the entry ID on that email?

    $id_number = $_SESSION['iphorm_2']['entry_id'];

    #15281
    bfagundes
    Participant

    OK I solved with


    $id_number = $form->getEntryId();

    This was quite a monologue, huh? xD

    #15286
    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 5 posts - 1 through 5 (of 5 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