Skip to main content

Sending email notification when enrolling via API

  • 18 July 2024
  • 4 replies
  • 39 views

I need to enroll individuals into a course who don’t belong to any of the usual groups/branches assigned to this course.

I also have an email digest notification that must go out with the enrollment.

I was able to locate the information about the notification

 

Here’s the API endpoint that I’m using
 

and here is the response that I get
 

UNFORTUNATELY,

the notifications never arrive. I know that the notifications DO work when I manually enroll via the UI in Course Management.

@Bfarkas @lrnlab Any ideas?

4 replies

Userlevel 5
Badge +1

I don’t know if I have the answer but one thing that caught my eye, @KMallette: I don’t think the id_job should be mapped to notification_uuids.

Given that notification_uuids is optional, have you tried making the enrollment POST request without it?

Userlevel 7
Badge +6

I don’t know if I have the answer but one thing that caught my eye, @KMallette: I don’t think the id_job should be mapped to notification_uuids.

Given that notification_uuids is optional, have you tried making the enrollment POST request without it?

Yes, I did … It didn’t make a difference one way or the other. I was just stabbing in the dark as I often do 🤣

Thanks!

Userlevel 5
Badge +1

Hmm. One more thought then, @KMallette: You mentioned it works when enrolling via the UI. The interesting thing is that from my own testing (enrolling from within course management), this is actually making an API call to the same endpoint, and you can see this for yourself with your browser Dev Tools:

Network Tab > Filter for Fetch/XHR > Request Payload

Now, uh, I didn’t test the notification part myself,* as you can see, but my point is that if you do this on your end you might be able to spot what a “successful” API call looks like (successful in that the notification does trigger).

* This is partly because I actually couldn’t figure out where to add the notification when enrolling direct from course management. I know how to add it when configuring an enrollment rule, but that’s a different thing of course.

Userlevel 7
Badge +6

Hmm. One more thought then, @KMallette: You mentioned it works when enrolling via the UI. The interesting thing is that from my own testing (enrolling from within course management), this is actually making an API call to the same endpoint, and you can see this for yourself with your browser Dev Tools:

Network Tab > Filter for Fetch/XHR > Request Payload

Now, uh, I didn’t test the notification part myself,* as you can see, but my point is that if you do this on your end you might be able to spot what a “successful” API call looks like (successful in that the notification does trigger).

* This is partly because I actually couldn’t figure out where to add the notification when enrolling direct from course management. I know how to add it when configuring an enrollment rule, but that’s a different thing of course.

BRILLIANT idea!  I’ll look at it from DevTools and see what I can find.

Thanks!!

Reply