Products that are not courses send out an Enrollment confirmation email

When a user purchases a product that is not a course the user still receives an Enrollment Confirmation. The text is --Congratulations! You have enrolled in course "" successfully!--. We are using the woocommerce store with your new integration. This issue occurs on two sites under our management. Could you help with this?

We have granted access to:

  • Michael Bissett

    Hey @ChooseGrowth, hope you're doing well this evening! :slight_smile:

    I'm not able to reproduce this over on my own test site presently, may I ask for an example of a product that's acting up like this, so I can try to duplicate this situation over on my test site?

    Also, was there a time that this was working properly, while having the integration enabled? If so, what changed around the time this started to occur?

    Please advise,

  • Black Fox

    Hey Michael,

    I have granted you access to one of the sites this is happening on. An example of the product that triggers the issue is any product in the woocommerce store that is not a coursepress-virtual-product.

    This issue was recently brought to my attention so I am unable to speak to whether it was working at one time. The majority of sites we manage only sell courses so this issue hasn't occurred before.

    My understanding of the engineering of the plugin is limited. What I believe is happening is that coursepress is sending an email after every woocommerce purchase. A possible solution might be to check if the purchases was a course?

    Thank you so much for taking the time to look into this. We love your plugin and appreciate the help.

  • Michael Bissett

    Hey @ChooseGrowth, no problem, glad to look into this for you! :slight_smile:

    I'm still not seeing the Enrollment Confirmation email show up for me, I tried testing inside of my own site again (both with PayPal & the Stripe gateway provided by Stripe for WooCommerce), and I also tested inside of your site as well (with the premium Stripe gateway), using sandbox mode in all of my testing here.

    I tried testing this product here while logged out on your site:

    What product did you try purchasing? What payment gateway was used? And were you testing it live, or were you doing your testing in the sandbox as well?

    Could you elaborate on that for me please? :slight_smile:

    Kind Regards,

  • Black Fox

    It looks like the issue presents itself when you are already logged in and are purchasing a product. If you are purchasing as a "guest" you will not get the enrollment email.

    We have been using coupons to give 100% off to the cart. I tried purchasing the same product you did, but I was signed in and got the enrollment email. There was no payment gateway used in this process. We only use the Stripe Gateway. We do not use sandbox.

    Access has been granted again.

  • Michael Bissett

    Hey @ChooseGrowth, really sorry for the delay on this one, it's been a pretty busy week for me. :slight_frown:

    The Support Access isn't playing nice with me right now, I keep getting an invalid access token error when I try logging in.

    I did try doing some extra testing on my own site (both inside the sandbox, as well as using live mode, with your coupon method), and I'm still not able to reproduce this issue while logged in.

    I'd like to have a deeper look at your site, as there seems to be something particular about it that's causing this to act differently. Could you please send in the following via our secure contact form:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress admin access details (login address, username & password)
    - Include FTP log-in details (hostname, username & password)
    - Include any relevant URLs for your site

    On the contact form (linked to below), please select "I have a different question", this ensures it comes through and gets assigned to me.

    Thanks a bunch! :slight_smile:

    Kind Regards,

  • Michael Bissett

    Hey @ChooseGrowth,

    ...boy, this was a weird one to troubleshoot! :disappointed:

    Even after doing some additional troubleshooting (which included disabling all of the plugins except for CoursePress, WooCommrece, and the Stripe & USPS add-ons), while I was able to see this behavior on your site, I still wasn't able to reproduce this behavior over on my own test site.

    However! I was able to get that "Enrollment Confirmation" email issue sorted out by modifying line 243 of:


    From this:

    if ( is_email( $email_args[ 'student_email' ] ) ) {

    To this:

    if ( is_email( $email_args[ 'student_email' ] ) && $course_id != '' ) {

    That'll make sure that there's a valid course ID when it comes to sending the confirmation email, and that it won't trigger if a blank ID is being passed (which is what appears to be coming up on your site).

    I'll bring this tweak up to the developer, so that he's aware of the fix. :slight_smile:

    Oh, and before you ask, I did test this fix with both course & non-course products, and found things to work just fine either way (really wanted to make sure that there wasn't some small thing missed here).

    Hope this helps! :slight_smile:

    Kind Regards,