• Resolved treska.eu

    (@treskaeu)


    Hi, thank you for your amazing plugin, but i have one question.

    Is it possible add generated PDF Coupon as mail attachment?

    • This topic was modified 3 years, 5 months ago by treska.eu.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi @treskaeu

    thank you for your message!

    Currently, the gift card is generated dynamically mainly to avoid some email clients/ programs that may sometimes block attachments. With a link and pdf gift card created on the fly, such an issue will not occur. You may also download/ create the pdf coupon and send it manually. I have informed our programmer about the idea to choose this behaviour (attachment or link or both).

    When such an option is added in the future I will inform you in this thread.

    If you have further questions let me know.

    Best regards,

    Hi great plugin, I was wondering the same as @treskaeu. Until you figure that out I have one more question.

    Is it possible to add another PDF file to be sent by default as the attachment to be downloaded together with Flexible PDF Coupon generated from your plugin? (In current situation, downloaded when clicking to the link in Email to recipient?)

    I am asking this because I am selling a gift certificate for tickets to events. Some customers want this certificate to use as a “physical” present to their friends. After being emailed from my website, they are going to the printing studio where they need to print the certificate “both sided”. and make it look like a ticket (A5,A6 format as set by the template).

    I need each PDF certificate sent from my site to have my FRONT (logo) side, and BACK (flexible PDF Cupon) genereted from your plugin. They both will be the same size, so they can be printed together both sided way. I added a FRONT PDF side as a media to my website library and been trying to find a hook, or a snippet code to edit and make it both PDF download together. Is this even possible? Can you please help with a code or something?

    Thank you!

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi @artbottega

    thank you for your message!

    You may edit the email template and add additional files as a link or attachmant.
    You may also use WooCommerce filter to add attachments (coupon as a link taken from a meta key and other files): https://www.businessbloomer.com/woocommerce-attach-file-pdf-emails/

    You could also use Shopmagic to create custom automated emails based on the order status.

    Let me know if the above solutions meet your needs.

    Best regards,

    Hi @tomasz_bednarek, thanks for your reply.

    I’m actually wondering if I can add downloadable link to my email, not as an attachment. I added pdf to my media files. I tried to simply add html code for download pdf

    <p><a href="<?php echo $meta['coupon_url']; ?>"><?php esc_html_e( 'Download PDF with the coupon &raquo;', 'flexible-coupons'); ?></a></p>
    <p><a href="https://www.artbottega.hr/wp-content/uploads/2021/01/coupon-wvfd70go9.pdf" download>Download test</a></p>

    As you can see I want that download is automatically when user clicks on the link. I have inspected elements on my email, but I didn’t see the download attribute in the anchor tag. Is it somehow removed somewhere in your plugin?

    Can you please explain how your link downloads pdf?

    Thank you!

    • This reply was modified 3 years, 4 months ago by artbottega.
    • This reply was modified 3 years, 4 months ago by artbottega.
    • This reply was modified 3 years, 4 months ago by artbottega.
    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi @artbottega

    thank you for your message!

    The plugin creates the PDF on-the-fly using the mpdf library.

    You may customize the coupon.php email template (with download attribute) and put it inside your theme’s folder: YOUR-THEME/woocommerce/emails/coupon.php

    You can also access and copy the template through WooCommerce->Settings->Emails menu tab.

    I hope it helps. If you have more questions let me know.

    Best regards

    Hi Tomasz,

    thank you for your reply. I am familiar with accessing coupon.php email template as well as customizing it.

    Can you please explain why the download attribute is not working when inserted in this template. I have tried to put this simple download attribute between lines of your code.
    <p>Download TEST</p>

    When the “You have received a cupon” email arrives it shows my “Download TEST” hyperlink text. When clicking on it, the browser only opens PDF in a new tab, it doesn’t starts downloading it automatically like it does to your link.

    Can you please share some thoughts and ides why this happens, when inserting a download attribute in template of your plugin?

    Thank you!

    Stipe

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi Stipe,

    thank you for your message!

    Please check the browser compatibility with the download attribute:
    https://caniuse.com/?search=download

    and browsers’ settings e.g.:
    edge://settings/content/pdfDocuments
    chrome://settings/content/pdfDocuments

    You may also read more on the topic and possible solutions here:
    https://www.w3schools.com/tags/att_a_download.asp
    Please note that Chrome 65+ and Firefox only support same-origin download links.

    Let me know if that helps

    Best regards,

    Hi Tomasz,

    many thanks for your quick response. The HTML link that I am setting is coming through woocommerce mail inbox as a link, instead of coming directly from the web. This makes it “lose” download data in the process with gmail/browser etc. In this situation it all depends on customer browser setting being turned on (automatic PDF download option). This situation is not a solution to my problem.

    Example – your file is coming from mpdf library = from the web.

    Do you know is there a chance I could “wrap up” my file inside of your plugin so it looks like it is also coming from the web directly? This way it won’t depend on browser seettings at all.

    Thank you in advance.

    P.S.
    I hope my terminology and example make easier to understand where I am coming from with this problem.

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi @artbottega

    thank you for your reply.

    The issue with browser lies in cross-origin files so that’s the main reason here. It is due to the security reasons implemented by the browsers.

    I have informed our programmer about the idea to allow direct downloading of the gift card without the need to change the browser’s settings. When it’s added in the future, I will inform you here.

    Best regards,

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi @treskaeu @treskaeu

    I wanted to inform you that we have added the possibility to turn on pdf gift cards as attachments in the PRO version of the plugin. Attachments may be therefore sent to the customer or recipient of the voucher.

    If you want to try/ test this option in PRO see the demo.

    I am closing the thread, If you have any further questions let me know – reopen this one or send in a new topic.

    Best regards,

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘PDF Coupons as attachment’ is closed to new replies.