• Resolved jodzeee

    (@jodzeee)


    I have “Admin New Appointment” selected, but I’m not receiving the PDF invoice attachment for those.

    03.08.2023-15.03.19

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hi @jodzeee

    Does it get attached to the New order email?

    Is that email from a third party plugin?

    Thread Starter jodzeee

    (@jodzeee)

    Yes, it gets attached to the new order email, but not the appointment one. The appointments are from Appointments for WooCommerce. The emails from them show up in WooCommerce settings and since they also show here in the PDF Invoice settings, I expected it to work.

    https://bookingwp.com

    thanks for your help!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @jodzeee,

    Please follow these steps to find out if the issue occurs before the message is sent:

    1. Install and activate the WP Mail Logging by MailPoet plugin
    2. Wait for the next Admin New Appointment notification.
    3. Then go to Tools > WP Mail Log, find your last Admin New Appointment email, and check if there are files in the Attachments column, and/or any notice on the Error column: A screenshot that display the WP Mail Logging plugin log screen
    4. Share the results with us 🙂
    Thread Starter jodzeee

    (@jodzeee)

    Hi Yordan. There are no errors. It successfully attaches and sends an .ics appointment file, but not the invoice.

    Thread Starter jodzeee

    (@jodzeee)

    Looking at the support forum at BookingWP, I found a topic that I think is the same problem. (I couldn’t find a matching topic in this, forum though.)

    Unfortunately, I can’t link to the BookingWP forum topic because you need to be logged in to read it — but basically, you told them:

    Note that our plugin requires an order object to be passed to the email – if the BookingWP plugin does not pass the order object to the 3rd argument of woocommerce_email_attachments, then our plugin doesn’t have the source data to create the invoice.

    They opened a ticket to add the functionality, but it hasn’t happened yet:
    https://bitbucket.org/bookingwp/woocommerce-appointments/issues/947/woocommerce-pdf-invoices-packing-slips

    They also said this:

    Would it help to know that you can get the order object from the appointment object like this $appointment->get_product_id()?

    Will that code help make this happen?

    Thread Starter jodzeee

    (@jodzeee)

    Here’s some additional information I received when asking if they have ideas of how to make this happen:

    Sadly, I cannot provide any code snippet to make this work. Because we’re using the filter to attach the ICS file and we’d pass the order object to all emails, then the appointment emails would contain the ICS for all appointments in the order (in case there are many) which makes no sense.

    The best option I see is to ask the authors of the PDF invoices plugin if there is a filter you could use to get the order object in case one is not passed to it. Because in that case, you can get the order object from the appointment object like this:

    $appointment->get_order()

    The whole code to check if the object is for an appointable product and if so to get the order object is:

    // Check if the object is for an appointable product
    if ( is_a( $object, 'WC_Appointment' ) ) {
    // If it is, get the order object and store it to use later
    $object = $object->get_order();
    }

    Is there anything you can do to help get the invoice to attach to the Admin New Appointment email?

    Plugin Contributor dwpriv

    (@dwpriv)

    @jodzeee

    I can try writing a snippet a attaches the PDF for that appointment status. It will be a bit tricky since I don’t have access to that plugin. What is the status of the appointment called?

    Thread Starter jodzeee

    (@jodzeee)

    That would be great. The status is set to COMPLETED once they’ve paid for an appointment order. Is that what you mean?

    Alternatively, are there any other email plugins that PDF Invoices works with other than WooCommerce native emails? For example, Follow-Ups or ShopMagic?

    Plugin Contributor dwpriv

    (@dwpriv)

    @jodzeee

    My apologies for the mix up. I was referring to the notification name, the one that is to be used in the filter. The status name is different than the notification name. You may need to ask the developers for this

    Regarding the email plugins, we’re aware of the compatibility with those plugins you listed. If those plugins have a free option, you can always do some tests with them and our plugin

    Thread Starter jodzeee

    (@jodzeee)

    I believe it would be:
    admin_new_appointment

    If you could write a snippet, that would be wonderful!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @jodzeee,

    Thanks for providing more details. Could you please write us to support@wpovernight.com, so we can continue investigating why that email notification is not attaching the PDF invoice? Please mention this topic.

    We will be looking forward to your reply there!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Invoice is not being attached to Appointment emails’ is closed to new replies.