Altus Campus – Petrone Front‑End User Import Tool

  Oct 12th, 2025   -     Adding Seats, Customer Success Management, Petrone Associates   -  

Petrone Front-End User Import

Bulk create or match users, enroll them into a course, notify users & admins, and download a post-run report — all from a WordPress page.

Overview

This tool provides an authenticated, front-end interface to import users for Petrone organizations. It reads a CSV, applies shared metadata (Facility, Role, Specialization, Address), creates new contacts or detects existing ones, enrolls them into a selected course, sends confirmation emails, and generates a downloadable CSV summary.

Shortcode:

Legacy Petrone import is disabled. Use an AltusPlatform API import flow instead.

Form Inputs

  • Specialization — from acc_categories.category_title
  • Professional Role — from ae_course_options.meta_value where LOWER(meta_key) LIKE '%role%'
  • Facility — from ae_organizations.display_name
  • Address, City, State, Zip/Postal, Country, Phone — text inputs applied to all imported users
  • Course — from ae_course.course_title site-scoped
  • CSV File — the user list to import

The Course dropdown is automatically limited to courses available to the current site via ae_package_sites (mapping site master_key to allowed course IDs).

CSV Format

Provide a header row and the following columns (Employee ID and Department are optional):

First Name,Last Name,Email,Employee ID,Department

Example rows:

Jane,Doe,jane.doe@example.com,EMP1001,Radiology
John,Smith,john.smith@example.com,EMP1002,Cardiology
Emily,Johnson,emily.johnson@example.com,,Nursing

How It Works

  1. Choose Specialization, Professional Role, Facility, Course, and enter shared contact details.
  2. Upload your CSV and submit.
  3. For each row:
    • Validate email, build a safe username (unique if needed).
    • Existing user? Enroll in the selected course (no duplicate account).
    • New user? Create the contact, enroll, and notify.
  4. On completion, download the enrollment results CSV.

Outputs & Notifications

  • User Email: Account + “Enrollment Confirmation” with the course title.
  • Admin Email: Summary including the enrolled course.
  • Results CSV: Saved to /wp-content/uploads/ and linked on-screen.
    Headers: First Name, Last Name, Email, Status, Course Title

Data Sources

Specializationacc_categories.category_title
Professional Roleae_course_options.meta_value where LOWER(meta_key) LIKE '%role%'
Facilityae_organizations.display_name
Courseae_course.course_title (limited via ae_package_sites)

Security & Compatibility

  • Nonce-protected form submission.
  • Server-side validation & sanitization.
  • PDO with exceptions enabled for database operations.
  • Works with PHP 7.4+ and WordPress multisite.

Troubleshooting

  • Course list is empty: Ensure the site’s master_key maps to allowed packages in ae_package_sites.
  • CSV rejected: Confirm the file has a header row and valid emails; use a plain CSV (UTF-8).
  • No emails sent: Check wp_mail configuration or SMTP plugin settings.
  • “Existing user” not created: That’s expected — existing users are only enrolled, not recreated.

Notes for Developers

  • Shortcode:
    Legacy Petrone import is disabled. Use an AltusPlatform API import flow instead.
  • Existing user detection via internal helper ac_get_contact_id().
  • Enrollment via ae_enroll_user(); course titles loaded from ae_course.
  • Course scoping: acc_keys.wp_blog_idacc_keys.master_keyae_package_sites.site_id → allowed ae_course.id.


Your Comment

Your email address will not be published.