A couple of migration queries

Home Forums Quform WordPress A couple of migration queries

This topic is: resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21913
    haitch
    Participant

    Hi

    Thanks for the update, it looks great and really what I needed.

    Ive migrated over all the forms which all went relatively smoothly. My issue is that we have a lot of pages and I have stored the id for each form in a custom field so the page knows what form it needs to load. Obviously after migrating, the form Ids have changed.

    I have changed the form ids directly in the database and this seems to have solved my main issue, the appropriate form is loading on the correct page now. My only worry is that I may have destroyed some relationships with other tables. I can see that I will need to change ‘quform_entries’ table to see the messages and ‘quform_entry_labels’. Have I missed anything you can think of, or could there be repercussions of doing it this way?

    We also have a function using the hook iphorm_pre_send_notification_email. I was a little confussed about how to change this over to the new hook.

    My orginal function (I have simpified it some what):
    function sh_iphorm_get_recipients($mailer, $form, $attachments)
    {
    $recipients = array(......) // contains list of recipients
    if (count($recipients)) {
    $mailer->clearAddresses();
    foreach ($recipients as $recipient) {
    $mailer->addAddress($recipient);
    //$mailer->SingleTo = true;
    }
    }
    return $mailer;
    }
    add_filter('iphorm_pre_send_notification_email', 'sh_iphorm_get_recipients', 10, 3);

    This is the code ive changed for the new hook, but Im a bit confussed about the ‘add_action’ and the notification unique ID at the end of the hook name (quform_pre_send_notification_1_1) that you mention in the documentation

    function sh_quform_get_recipients(PHPMailer $mailer, Quform_Notification $notification, Quform_Form $form)
    {
    $recipients = array(......) // contains list of recipients
    if (count($recipients)) {
    $mailer->clearAddresses();
    foreach ($recipients as $recipient) {
    $mailer->addAddress($recipient);
    //$mailer->SingleTo = true;
    }
    }
    }
    add_filter('quform_pre_send_notification', 'sh_quform_get_recipients', 10, 3);

    is it suposed to be
    add_action( 'quform_pre_send_notification', 'sh_quform_get_recipients', 10, 3 );

    Last question, I used the following to load the forms in my template files:
    if (function_exists('iphorm')) echo iphorm($form_id);
    if (function_exists('iphorm_popup')) 'iphorm_popup( $form_id )

    I cant seem to find the Quform equivalent. have tried ‘quform’, ‘Quform’, ‘quform_form’ and ‘Quform_Form’, but none seem to work.

    Thanks for you time

    Helen

    • This topic was modified 6 years, 7 months ago by haitch.
    #21920
    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.

    • This reply was modified 6 years, 7 months ago by Ally.
    #21936
    haitch
    Participant

    Hi Ally

    Thanks for the response, it certainly has put my mind at ease.

    I did notice the issue with the autoreply with the notification hook. Is there a way I can check if its the autoreply being sent. Currently the only thing I can easily see is using the subject line.

    if ($mailer->Subject != 'Thank you for your enquiry')

    Unfortunately if the subject of the Autoreply changes the code stops working, Is there a better way?

    Thanks again for your time.

    Helen

    #21943
    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.

    #21947
    haitch
    Participant

    Thats great, thank you so much for the help.

    Helen

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