• Resolved riyaseasternts

    (@riyaseasternts)


    Hello,

    I have two concerns. I am creating and saving pdf on form submission with custom code. now if submission gets deleted, i want to delete my pdf. so for that i have saved the pdf name in the entry meta like displayed in attached screenshot https://prnt.sc/Rx83xkE7TN3g . Now, another thing is I want to display this PDF and Register_number in the submission data in the backend. Guide me through this. I have tried some hooks but not able to get successful results. so provide me the hooks for this https://prnt.sc/dkmAtLvxxg5x .

    I also want to start my submission id with 0001 and it will be autoincremented as soon as user fill up the form.

Viewing 14 replies - 16 through 29 (of 29 total)
  • Thread Starter riyaseasternts

    (@riyaseasternts)

    Hello, Also this creates a subfolder inside my custom folder. I don’t want that. basically, i am saving my data with custom file name and calling it with custom folder. so please help me with this. it’s really urgent.

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @riyaseasternts

    I can understand your concerns here however as mentioned about the custom development our support is limited and we can’t help you much here that is why we suggest to send us an email.

    To provide more accurate answers, I have forwarded your questions to our development team for review, we will follow up with you once we have more information.

    Best Regards,
    Amin

    Thread Starter riyaseasternts

    (@riyaseasternts)

    Hello,
    Thankyou for the response.
    Currently, forget about this subfolder. But I am integrating payment gateway and on submitting the form, my email is being triggered, which is wrong.
    Basically, email should be triggered after the payment gateway response. I have a php file for handling the payment gateway response. now how can i prevent an email on submit button click and send it after the payment response? Please reply, it’s urgent.

    Plugin Support Laura – WPMU DEV Support

    (@wpmudevsupport3)

    Hi @riyaseasternts

    Hope this message finds you well.

    We got feedback for the subfolder thing in case you need it, you only need to use the Forminator feature at Forminator >> Settings >> Data:

    To handle the email before it is sent, you might need to use this hook:

    forminator_custom_form_mail_before_send_mail

    Any customization is outside the scope of support we can provide. For that, you’ll need to hire a developer to provide the required custom code for you. WordPress provides a jobs directory here https://jobs.wordpress.net/, if you need further advice about it, feel free to email [email protected], Subject: ATTN: WPMU DEV support – wp.org

    Best regards,
    Laura

    Thread Starter riyaseasternts

    (@riyaseasternts)

    hello,

    I have already shared the screenshot of this subfolder thing. But it is also creating subfolder inside that with multiple files.

    moreover, for the email, my question was different. I want to prevent the email on submit button click because it is redirecting to the payment gateway and once the payment response returns, then i want to trigger the email. I can’t find the send_mail trigger (action or filter) anywhere in the plugin.

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @riyaseasternts ,

    I have already shared the screenshot of this subfolder thing. But it is also creating subfolder inside that with multiple files.

    Yes, it’ll be creating the folder structure like following where the file will be uploaded:
    ?uploads/subfolder/form_id_random_strings/uploads

    As explained in the previous response:
    https://www.ads-software.com/support/topic/display-custom-meta-field-in-submission-wp-admin/#post-18053972

    You should be using forminator_custom_upload_subfolder to return an empty subfolder.

    moreover, for the email, my question was different. I want to prevent the email on submit button click because it is redirecting to the payment gateway and once the payment response returns, then i want to trigger the email. I can’t find the send_mail trigger (action or filter) anywhere in the plugin.

    You can find send_email function under /forminator/library/modules/custom-forms/front/front-action.php

    Regards,

    Nithin

    Thread Starter riyaseasternts

    (@riyaseasternts)

    Hello,
    I did use the forminator_custom_upload_subfolder?the function and returned the empty subfolder. but it is not working.

    For the email thing, simple question, do you know how to stop sending an email on submit button click and send it after some custom actions? all the forms have the hooks to trigger the email . Like woocommerce has actions to send the email on particular action.

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @riyaseasternts

    In case you don’t want to send the email from the click button you can remove the emails from Form > emails and use some available options

    forminator_custom_form_submit_before_set_field hook has a third parameter that contains the fields and the submitted data.

    forminator_form_after_handle_submit This works when the form is not submitted via Ajax.

    If it’s not the case then the hook won’t help and you need to use forminator_form_after_save_entry but it has two args $form_id, $response instead of $entry_id, $form_id, but then you will need to create your own email handler.

    Finally, you may have a look at forminator/library/modules/custom-forms/front/front-action.php > Line 120 for filters related to before and after email or on how you can handle the email processing.

    For forminator_custom_upload_subfolder, I tested that filter just by returning the empty string and no subfolder was created, could you use the filter, return an empty string “” and add a new custom dir in Forminator settings so it starts fresh?

    Best Regards
    Patrick Freitas

    Thread Starter riyaseasternts

    (@riyaseasternts)

    Hello,
    Subfolder issue is resolved but still need to rename the file with what I have stored in my custom table in database.

    Moreover, for the email, you are still not getting my point. check the screenshots. Woocommerce have option to remove the email and trigger the email at desired time
    https://prnt.sc/wORs-nAkLe7G
    https://prnt.sc/m-TeV0fxbvlP

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @riyaseasternts,

    Thank you for the explanation.

    We’re reviewing your requests with the team, and will be updating you when we have more feedback from the developers.

    Best Regards,
    Dmytro

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @riyaseasternts,

    We have further feedback from the developers below.

    Subfolder issue is resolved but still need to rename the file with what I have stored in my custom table in database.

    You can call your custom function using forminator_form_before_handle_submit and forminator_form_before_save_entry hooks:

    – use this one when Page Reload method is enabled for the form in Behavior >> Submission Behaviour:
    add_action( 'forminator_form_before_handle_submit', 'your_file_name_change_function', 10, 1 );

    – and this one is for the Ajax submission method:
    add_action( 'forminator_form_before_save_entry', 'your_file_name_change_function', 10, 1 );

    They are defined in library/abstracts/abstract-class-front-action.php:
    https://prnt.sc/JeolQo2d1ll_
    https://prnt.sc/55KE9U0ct8t6

    Moreover, for the email, you are still not getting my point. check the screenshots.

    Unfortunately there’s no option in Forminator to postpone, or stop email sending. In order to achieve what you want, you can remove the email notification from the form, and send it using custom code instead.

    I hope this helps. Please let us know if you have any further questions.

    Best Regards,
    Dmytro

    Thread Starter riyaseasternts

    (@riyaseasternts)

    You can call your custom function using forminator_form_before_handle_submit and forminator_form_before_save_entry hooks:

    – use this one when Page Reload method is enabled for the form in Behavior >> Submission Behaviour:
    add_action( 'forminator_form_before_handle_submit', 'your_file_name_change_function', 10, 1 );

    – and this one is for the Ajax submission method:
    add_action( 'forminator_form_before_save_entry', 'your_file_name_change_function', 10, 1 );

    I have used these actions but they are not returning any entry of this current form. and these files just have do_action but not able to fetch the entry from form ID. and even if i fetch the details how will I change the file name here? it will not change any form field data which further gets submitted.

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @riyaseasternts

    Those are before you save the entry, you would be able to use

    $form_data = Forminator_CForm_Front_Action::$prepared_data;

    or just get it with
    $_POST['field_name'] or $_REQUEST['field_name']

    But note, Forminator uses wp_unique_filename() function so you will need to inject inside the forminator_form_before_handle_submit & forminator_form_before_save_entry the wp_unique_filename

    add_filter( 'wp_unique_filename', 'your_custom_function', 10, 1 );

    https://developer.www.ads-software.com/reference/hooks/wp_unique_filename/

    Best Regards
    Patrick Freitas

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @riyaseasternts,

    Since we haven’t heard from you for a while. I’ll mark this thread as resolved for now. Please feel free to re-open this thread if you need any further assistance.

    Kind Regards
    Nithin

Viewing 14 replies - 16 through 29 (of 29 total)
  • You must be logged in to reply to this topic.