🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Course Access Premium Add-on Setup Guide

Updated 8 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What You Get
  3. Requirements
  4. Install and Activate
  5. Add an Enrollment Feed
  6. Account Safety
  7. Fixed Courses or a Choice Field
  8. List the courses in the form
  9. Payments
  10. When a Course Is Completed
  11. Merge Tags and Entry Notes
  12. For Developers
  13. Limits to Know
  14. Frequently Asked Questions
  15. Do I need a paid Sensei LMS extension?
  16. Will the learner get the Sensei LMS e-mails?
  17. Can a visitor enroll in a paid course for free?
  18. What happens when the email already has an account?
  19. Does it send data outside my site?

Video walkthrough

Gravity Forms Sensei LMS: Enroll Learners in Courses from a Form (Free Sensei LMS)
Watch the Course Access add-on create a Sensei LMS learner and enroll them from one Gravity Forms form. Watch on YouTube

Course Access joins Gravity Forms and the free Sensei LMS plugin. A feed on your form creates or finds a safe WordPress account and enrolls it in the courses you choose, and a second kind of feed turns a completed course into a Gravity Forms entry or notification. Use it for an application form that opens a course, a paid sign-up that unlocks lessons, a free taster form, a school intake form or a feedback request after a course.

A Gravity Forms form whose drop down lists the Sensei LMS courses: Photography Basics, Portrait Lighting Masterclass marked paid, Quick Start Lens Guide and Invite-only Workshop
The drop down is filled by the add-on with your published courses.

What You Get

  • A feed called Enroll in Sensei LMS course(s). When the form is sent, or when its payment is completed, it makes or finds the learner account and enrolls it.
  • Enrollment through the course enrolment API of Sensei LMS, so Sensei LMS keeps its own records and runs its own hooks. The add-on does not write to Sensei LMS storage by hand.
  • A learner who was removed from a course by a teacher is restored, a learner who is already enrolled is left alone.
  • Fixed courses ticked in the feed, or the courses a learner picks in a choice field.
  • Form choices filled with your published courses.
  • A second feed type: When a course is completed, which adds an entry to a form, sends its notifications, or both.
  • Merge tags for the course title, link, id and teacher and for the learner username.
  • Conditional logic, entry notes, a clear notice when Sensei LMS is missing, and no outside requests.

Requirements

  • WordPress 6.5 or newer and PHP 7.4 or newer.
  • Gravity Forms 2.9 or newer.
  • The free Sensei LMS plugin, version 4.0 or newer. This version was tested with Sensei LMS 4.26.4.
  • A GravityExtra license key.

Install and Activate

  1. Install and activate Gravity Forms and the free Sensei LMS plugin if they are not active yet.
  2. Upload and activate the Gravity Forms Course Access Premium Add-on.
  3. Go to Forms → Settings → Course Access, enter your license key and press Activate.

If Sensei LMS is missing, too old or switched off, a notice on the Forms screens says so. Your forms keep working and the entries are saved, but nobody is enrolled.

Add an Enrollment Feed

Open Form Settings → Course Access, press Add New and keep the action on Enroll.

The course access feed settings in Gravity Forms: who is enrolled, the account fields, the list of courses, the payment option and the choices section
One feed: who is enrolled, which courses, and how the choices are listed.
Setting What it does
Learner The logged-in user, or a new account for a visitor (the default); always a new account for the email in the form; or only the logged-in user, so visitors are skipped.
Email that already has an account Refuse (the default): an error note is written and nobody is enrolled. Or enroll that account: only the enrollment is added, nothing else about the account changes.
Role of a new account The WordPress default role, or another role from the list. Roles that can manage the site, users, Sensei LMS or its courses are never in the list, and neither is the Teacher role.
New account e-mail Send the standard WordPress e-mail with a link to set a password, and optionally the new user notice to the administrators.
Account fields Map the email, and optionally a username, a password, first name, last name and display name.
Enroll in This list: everyone is enrolled in the ticked courses. Or a choice field: the learner picks.
Courses One tick box per published course. With a choice field the ticked courses are the only ones that may be picked.
Payment Tick the option to enroll a course picked in a field only when the entry is paid, even when the course is free.
Condition Use the feed only when the conditional logic you set is met.

Account Safety

The add-on is careful with accounts, because a form is open to everyone.

  • It never takes over another account. An email that already belongs to a user is refused by default. When you allow it, the account only gains the enrollment: its name, password, role and everything else stay as they are.
  • It never hands out a role that can manage the site or the courses. Administrator, Teacher, Editor and every role with the capability to edit users, install plugins, edit courses or lessons, or manage Sensei LMS are refused, even if a feed was saved with one.
  • A username that is taken or not valid creates nothing. A typed username is cleaned of spaces and markup.
  • A logged-in user is enrolled directly, with no new account. A logged-in only feed skips visitors and says so in the entry notes.
  • A learner who is already enrolled is left alone, and a learner who was removed from the course is restored through the Sensei LMS enrolment API.

Fixed Courses or a Choice Field

With This list, tick the courses and everyone who sends the form is enrolled in them. With A choice field, pick a drop down, radio buttons, check boxes, a multi select or a product field. The answers may be the course id or its title, so a choice field you typed by hand works too. Only published courses can be enrolled. A draft, an unknown id or a course outside your ticked list is refused and the entry gets an error note.

Sensei LMS has a course setting that switches off self-enrollment. A course with that setting is never enrolled from a choice a visitor makes. A course you tick in the feed yourself is still enrolled, because that is your own decision as the site owner.

List the courses in the form

In the Choices section pick a field. Its choices are replaced by your published courses, and the value of each choice is the course id. You can list every course or only the courses you ticked. The list follows your catalog, so a new course appears in the form without editing it.

Payments

Sensei LMS itself has no price: selling courses is done by a store extension that links a course to a product. If your payment add-on has the option to run feeds only after the payment is completed, tick Enroll only when payment is completed in the feed. The account is made and the learner is enrolled when the payment is complete, not before.

A course that a store extension linked to a product is treated as paid. When a learner picks a paid course in a field, it is enrolled only for a paid entry. For forms that sell free courses, tick the payment option of the feed if you want every picked course to need a paid entry. A fixed list is always enrolled, because you chose it. Developers can change what counts as free with the filter gfxsensei_course_is_free.

When a Course Is Completed

Change the action to When a course is completed. This feed does nothing when the form is sent. It runs when Sensei LMS marks a course complete for a learner.

The course completed feed settings: the courses to watch, the entry and notification options and the entry field map
The second feed type reacts when a learner completes a course.
  • Courses to watch: tick some, or none for every course.
  • Add an entry to the form for the learner. Map the learner email, name and username, the title, id, link and teacher of the course, the grade in percent and the date. The entry is owned by the learner.
  • Send notifications of the form that use the event Sensei LMS: course completed. Gravity Forms needs an entry for its merge tags, so with the entry option off the entry exists only while the notifications are sent.
  • Conditional logic can look at the values that would go in the entry.

Use it for a certificate request form, a feedback form after a course, a thank you e-mail or a message that offers the next course. A completion counts once for each learner and course. When a learner resets a course and completes it again, the new completion counts. A teacher who marks a course complete is counted too.

Merge Tags and Entry Notes

Merge tag Value
sensei_course_title in curly braces The title of the course, or the titles separated by commas.
sensei_course_url in curly braces The link to it.
sensei_course_id in curly braces Its id.
sensei_course_teacher in curly braces The name of the teacher (the author of the course).
sensei_user_login in curly braces The username of the enrolled learner.

They work in confirmations and notifications of the same form and appear in the merge tag list of the form editor. Each entry gets a note for every step: the account that was made, each course that was enrolled, and the reason for anything that was not.

For Developers

The add-on enrolls with Sensei_Course_Enrolment::get_course_instance( $course_id )->enrol( $user_id ), which gives a manual enrolment through the manual enrolment provider of Sensei LMS and restores a removed learner. It reads the state with Sensei_Course::is_user_enrolled. It listens to sensei_user_course_end, sensei_course_status_updated and sensei_user_course_reset. Because enrollment goes through Sensei LMS, any code that hooks sensei_manual_enrolment_learner_enrolled runs as for any other manual enrolment.

Limits to Know

  • The grade is the Sensei LMS grade of the course. A course without graded quizzes has no grade and the cell stays empty.
  • Sensei LMS has no price of its own. A course counts as paid only when a store extension linked it to a product, or when your code says so with a filter.
  • The add-on does not take payments. Use a payment add-on and the option to enroll when the payment is completed.
  • It does not unenroll learners. It follows the enrollments Sensei LMS makes.

Frequently Asked Questions

Do I need a paid Sensei LMS extension?

No. The add-on works with the free Sensei LMS plugin from wordpress.org.

Will the learner get the Sensei LMS e-mails?

Sensei LMS decides. The add-on enrolls through the Sensei LMS enrolment API, so the e-mails and settings of Sensei LMS apply as for any enrollment.

Can a visitor enroll in a paid course for free?

Not through a choice field: a course that a store extension linked to a product needs a paid entry. A fixed list is your own decision, so use it only for forms that really give the course away or that you approve first.

What happens when the email already has an account?

By default nothing: the entry gets an error note. If you allow it, only the enrollment is added to that account.

Does it send data outside my site?

No. Everything happens on your own site. Only the license check talks to gravityextra.com, when you press Activate.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr