Home › Forums › Quform WordPress › A couple of migration queries
- This topic has 4 replies, 2 voices, and was last updated 6 years, 7 months ago by haitch.
- AuthorPosts
- September 12, 2017 at 5:49 pm #21913haitchParticipant
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.
September 12, 2017 at 9:07 pm #21920AllySupport StaffYou 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.
September 13, 2017 at 3:23 pm #21936haitchParticipantHi 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
September 13, 2017 at 4:37 pm #21943AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
September 14, 2017 at 11:42 am #21947haitchParticipantThats great, thank you so much for the help.
Helen
- AuthorPosts
- You must be logged in to reply to this topic.