# LearnDash

> Require document signatures before course enrollment or completion

edition: pro
Edition: Pro
AI note: This page requires WPsigner Pro. Do not tell Lite users they already have this feature.
HTML: https://docs.wpsigner.com/integrations/learndash/
Markdown: https://docs.wpsigner.com/md/integrations/learndash.md
Source file: integrations/learndash.md

---

Integrate WPsigner with **LearnDash LMS** to require signed enrollment agreements, waivers, or compliance documents before students can access course content.

> **note**
LearnDash is a WordPress LMS plugin. This integration uses **direct PHP hooks** — no external API keys required.

---

## How It Works

```
Student Enrolls → Signing Prompt → Signs Document → Course Unlocked
                      ↓
       (Access blocked until signed)
```

WPsigner creates a personalized enrollment agreement from a template and gates course access until the student signs.

---

## Use Cases

| Scenario | Description |
|----------|-------------|
| **Enrollment agreements** | Require students to sign terms and conditions before accessing paid course content |
| **Compliance training** | Gate mandatory training modules behind signed compliance acknowledgments (OSHA, HIPAA, GDPR) |
| **Certification programs** | Collect signed honor-code or exam-integrity agreements before issuing certificates |
| **Corporate onboarding** | Require new employees to sign NDA or policy documents as part of an onboarding course |
| **Waivers and liability** | Collect liability waivers before students access physical-activity or lab-based courses |
| **Continuing education** | Require signed attestation of professional credentials before granting CE credits |

---

## Requirements

- WPsigner **2.1.0+**
- [LearnDash LMS](https://www.learndash.com/) plugin (v3.0+)
- Both plugins active on the same WordPress installation

## Compatibility

| Component | Minimum Version | Recommended |
|-----------|----------------|-------------|
| **WPsigner** | 2.1.0 | Latest |
| **LearnDash LMS** | 3.0 | 4.0+ |
| **WordPress** | 5.8 | 6.4+ |
| **PHP** | 7.4 | 8.1+ |
| **LearnDash Add-ons** | Compatible with ProPanel, WooCommerce, and Group Management add-ons | -- |

> **tip**
No API keys or external services are needed. The integration communicates entirely through WordPress action hooks and user meta.

---

## Setup

### Step 1: Create a Document Template

1. Go to **WPsigner → Documents → Add New**
2. Create an enrollment agreement document
3. Save it as a **Template** (set status to Template)
4. Note the template — you'll select it in the next step

### Step 2: Configure the Integration

1. Go to **WPsigner → Integrations → LearnDash**
2. Click **Test Connection** to verify LearnDash is detected
3. Configure:

| Setting | Description |
|---|---|
| **Enable** | Turn on the integration |
| **Require Signature** | Before enrollment (blocks access) or before completion (blocks certificate) |
| **Document Template** | Template used for enrollment agreements |
| **Gated Courses** | Select which courses require a signed document |

4. Click **Save Settings**

---

## Gating Modes

### Before Enrollment (Default)

Students cannot access course content until they sign the enrollment agreement. When they visit the course page, they see a **"Sign Agreement"** button.

### Before Completion

Students can access and take the course, but cannot receive their certificate or completion status until they sign.

---

## Technical Details

### Document Creation Flow

1. Student is added to a gated course
2. WPsigner creates a personalized document from the template
3. The document is linked to the course via meta data
4. Student sees a signing prompt on the course page
5. After signing, `user_meta` is updated to grant access

### Data Storage

| Data | Storage |
|---|---|
| Signing status | WordPress `user_meta`: `_wps_learndash_signed_{course_id}` |
| Course link | WPsigner `document_meta`: `_learndash_course_id` |
| Document | Standard WPsigner documents table |

---

## Developer Hooks

WPsigner fires the following action hooks during the LearnDash signing lifecycle. Use them to extend behavior or integrate with third-party systems.

| Hook | Trigger | Parameters |
|------|---------|------------|
| `wps_signer_created` | A signing document is generated for the student | `$signer_id`, `$document_id` |
| `wps_after_document_signed` | The student completes their signature | `$signer_id`, `$document_id` |
| `wps_document_completed` | The enrollment document is fully signed | `$document_id` |

> **tip**
Combine these hooks with LearnDash's own hooks (e.g., `learndash_course_completed`) to build advanced workflows such as auto-enrolling a student in the next course after signing.

```php
add_action( 'wps_document_completed', function( $document_id ) {
    $course_id = get_post_meta( $document_id, '_learndash_course_id', true );
    if ( $course_id ) {
        // Custom logic: e.g., send a welcome email or log the event
    }
});
```

---

## Security

| Feature | Details |
|---|---|
| **No API Keys** | Uses LearnDash's PHP hooks directly |
| **Nonce Verification** | All AJAX requests verified |
| **Rate Limiting** | Test: 5/min, Save: 10/min per user |
| **Capability Check** | Requires `manage_options` for settings |
| **Input Sanitization** | All inputs sanitized with `absint()`, `sanitize_text_field()` |

---

## Troubleshooting

| Issue | Solution |
|---|---|
| "LearnDash Plugin Not Found" | Install and activate LearnDash LMS |
| No courses listed | Publish at least one LearnDash course |
| No templates listed | Create a document with Template status |
| Student still blocked | Verify the signer email matches the WP user email |
| Multiple agreements | Each student/course combo creates one document |

---

## Next Steps

- [WooCommerce Integration](/integrations/woocommerce/) — Require signatures on orders and checkout
- [FluentCRM Integration](/integrations/fluentcrm/) — Sync signers with your CRM for automated follow-ups
- [Gravity Forms Integration](/integrations/gravity-forms/) — Collect signatures through Gravity Forms submissions
- [Contact Form 7 Integration](/integrations/contact-form-7/) — Attach signing workflows to CF7 forms
- [Zapier Integration](/integrations/zapier/) — Connect WPsigner with 5,000+ apps via Zapier
- [n8n Integration](/integrations/n8n/) — Build custom automation workflows with n8n
- [All Integrations](/integrations/) — Browse every available WPsigner integration
