• Resolved cosmos42

    (@cosmos42)


    Hi there,

    I was wondering if there’s an option to generate a pdf from a woocommerce order and then attach it to any custom email (not a woocommerce email).

    To give a little more context, once a customer has completed an order in our shop, he will receive an email with the invoice attached.
    While that is working perfectly, we also need to generate another, different invoice and attach it to a custom email that is send to a different address.

    In order to do that the content of the invoice (or maybe the template that is used) would need to change according to the email type that is send (or some php variable).
    Then it would need to be attached to a custom email ( using wp_mail() ).

    Is there a way to achieve this programmatically? Does the premium version of your plugin provide this functionality?
    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @cosmos42,

    1. Which are the difference between both invoices?
    2. Will both invoices be generated for the same order, or only one based on a certain condition?
    Thread Starter cosmos42

    (@cosmos42)

    Hey,

    Both invoices are generated for the same order.
    There’s a product in our shop that – whenever it is purchased (or part of a larger order) – requires us to create a second invoice once the order is completed.

    This second invoice doesn’t charge the customer, but our own company instead. So some data like the billing address and the biller information needs to be changed while some of the data from the order (custom product meta like “duration”, “start_date”, etc.) needs to remain.

    I’ve already looked into creating custom invoice templates, however the tricky part seems to be to dynamically switch between multiple templates (while also attaching them to e-mails).

    Thanks for the fast reply!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @cosmos42,

    Thanks for the clarification.

    Creating an extra document requires quite work, but the Professional extension includes the proforma invoice that you can use as your second business invoice, although you may need extra help to change your business information and activate the document only if the product is present in the order, but we can offer it as part of premium support thought support@wpovernight.com

    If you need a custom new document, different to the proforma invoice, this can certainly be done, although it would be a custom job that is not covered by our free or premium support. My colleague Michael does this type of work and if he has room in his agenda he could estimate this job for you. If you are interested, please contact us by support@wpovernight.com

    Thread Starter cosmos42

    (@cosmos42)

    Alright, I’ll have a look into it. Thanks for the suggestions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Attach PDF to custom email’ is closed to new replies.