Home › Forums › Quform WordPress › Custom Autoreply problem
- This topic has 4 replies, 2 voices, and was last updated 9 years ago by Ally.
- AuthorPosts
- May 12, 2015 at 12:37 am #15275bfagundesParticipant
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();
May 12, 2015 at 12:59 am #15276bfagundesParticipantSince 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);
May 12, 2015 at 12:48 pm #15280bfagundesParticipantSo, 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'];
May 12, 2015 at 1:04 pm #15281bfagundesParticipantOK I solved with
$id_number = $form->getEntryId();
This was quite a monologue, huh? xD
May 12, 2015 at 1:46 pm #15286AllySupport 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.