• Resolved busybees

    (@mick69145)


    Since the last update, the file name for the PDF has been supplemented with the entry number (a variable). In version 0.9.9.3, this was just the file name (static). So e.g. from filename.pdf (v 0.9.9.3) to filename-64873k845q397.pdf (v 0.9.9.4)

    Is it possible to supplement the filename with a variable? For example a field from the form? This way the filename is unique but more obvious for the receiver. If so, how to achieve this?

    • This topic was modified 1 year, 8 months ago by busybees.
    • This topic was modified 1 year, 8 months ago by busybees.
Viewing 12 replies - 1 through 12 (of 12 total)
  • I want this too! for example [name].pdf

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    Yes, in older versions there was the [name].pdf structure, but it caused problems when sending forms at the same time.

    Thanks

    Thread Starter busybees

    (@mick69145)

    Hi Florent,

    I understand why you added the variable to the filename so there is not conflict with duplicated filenames. Currently the DB entry ID is added after the filename. My question is if it’s possible to develop a feature that you can add a form variabele like [first-name] or [email] to the filename instead of the entry ID. This way the filename is more userfriendly and still unique.

    So instead of filename-[entry-id].pdf you can do filename-[name].pdf

    Thanks in advance!

    • This reply was modified 1 year, 8 months ago by busybees.
    Plugin Author Florent Maillefaud

    (@florent73)

    Ok i’m working on it!

    Thanks

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    Can you downloading and testing this version on GitHub : https://github.com/Florent73/send-pdf-for-contact-form-7

    If you use tags in the “You can use this tags” option, this will complete the PDF name, otherwise it will tag [reference].

    Thanks to your returns

    Thread Starter busybees

    (@mick69145)

    Hi!

    Sorry for my late response. Just tested the function and works as expected, The only problem is when I enter a field variabele from the form like [name], I get a 404 error when loading the PDF in browser after submitting.

    So when I set [name] as variable the will be filename-[name].pdf When I submit the form this is e.g. filename-john.pdf. The file I receive by email is okay. The pdf in browser shows a 404. When I check the address it says /*filename-name-[reference].pdf. When I check the files via SFTP I see it’s the same as in the email.

    Can you fix the path generated in the browser so it shows the PDF instead of a 404?

    May thanks in advance!

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    Can you testing with my GitHub version?

    I have find the problem and resolved it!

    Thanks

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    This problem is if you redirect to the PDF after submit form.

    The rule:
    If you use a tag for the name of your PDF, disable the “Redirects directly to the PDF after sending the form?” option.

    Ex: https://demo.restezconnectes.fr/send-pdf-for-contact-form-7-simple-form/

    Thanks

    Thread Starter busybees

    (@mick69145)

    Hello,

    I indeed redirect to the PDF in a new browser window, after form submission. If I understand you correctly this redirect does not work in combination with a tag used for the filename?

    In your example I see you redirect to a page where you can click on a link and then the PDF opens. How to generate this link? I can create a page where I redirect after submission with a button that links to the PDF.

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    Yes, because the name of PDF is generated before form submission. I’m working for generate the name after submission.. but no finded!

    Redirect on a new page after submission with this shortcode:

    [wpcf7pdf_download]

    You can choose a text and dashicons for the button:

    [wpcf7pdf_download textbutton="Télécharger" dashicons="dashicons-admin-site" class=""]

    Thanks

    Plugin Author Florent Maillefaud

    (@florent73)

    Hi!

    Can you trying my lastest version on GitHub?

    I found the solution pour used form tags in PDF name.

    Thanks

    So this is a good fix, but is there a way to change the name of the attachment to the email based on tags in the form?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Filename variable’ is closed to new replies.