Changeset 3328198
- Timestamp:
- 07/15/2025 11:53:35 AM (9 months ago)
- Location:
- engagebay-add-on-for-learndash
- Files:
-
- 29 added
- 8 edited
-
tags/1.1 (added)
-
tags/1.1/assets (added)
-
tags/1.1/assets/css (added)
-
tags/1.1/assets/css/admin-style.css (added)
-
tags/1.1/assets/js (added)
-
tags/1.1/assets/js/admin-engagebay.js (added)
-
tags/1.1/engagebay-learndash.php (added)
-
tags/1.1/includes (added)
-
tags/1.1/includes/admin (added)
-
tags/1.1/includes/admin/class-engagebay-learndash-activator.php (added)
-
tags/1.1/includes/admin/class-engagebay-learndash-admin.php (added)
-
tags/1.1/includes/admin/class-engagebay-learndash-deactivator.php (added)
-
tags/1.1/includes/admin/class-engagebay-learndash-settings-page.php (added)
-
tags/1.1/includes/admin/class-engagebay-payment-gateway.php (added)
-
tags/1.1/includes/api (added)
-
tags/1.1/includes/api/class-engagebay-learndash-api.php (added)
-
tags/1.1/includes/class-engagebay-learndash.php (added)
-
tags/1.1/includes/events (added)
-
tags/1.1/includes/events/class-engagebay-learndash-course.php (added)
-
tags/1.1/includes/events/class-engagebay-learndash-group.php (added)
-
tags/1.1/includes/events/class-engagebay-learndash-quiz.php (added)
-
tags/1.1/includes/events/class-engagebay-learndash-user.php (added)
-
tags/1.1/includes/settings (added)
-
tags/1.1/includes/settings/class-engagebay-learndash-metabox-section.php (added)
-
tags/1.1/includes/settings/class-engagebay-learndash-preferences-section.php (added)
-
tags/1.1/includes/settings/class-engagebay-learndash-settings-section.php (added)
-
tags/1.1/readme.txt (added)
-
tags/1.1/services (added)
-
tags/1.1/services/class-engagebay-learndash-rest-api.php (added)
-
trunk/assets/css/admin-style.css (modified) (2 diffs)
-
trunk/engagebay-learndash.php (modified) (1 diff)
-
trunk/includes/admin/class-engagebay-payment-gateway.php (modified) (2 diffs)
-
trunk/includes/api/class-engagebay-learndash-api.php (modified) (7 diffs)
-
trunk/includes/class-engagebay-learndash.php (modified) (1 diff)
-
trunk/includes/events/class-engagebay-learndash-course.php (modified) (1 diff)
-
trunk/includes/settings/class-engagebay-learndash-preferences-section.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
engagebay-add-on-for-learndash/trunk/assets/css/admin-style.css
r3324935 r3328198 179 179 display: flex; 180 180 align-items: baseline; 181 margin-bottom: 8px; 181 182 } 182 183 … … 219 220 } 220 221 221 .width- 20 {222 width: 20%;223 } 222 .width-30 { 223 width: 30%; 224 } -
engagebay-add-on-for-learndash/trunk/engagebay-learndash.php
r3324935 r3328198 12 12 * Plugin URI: https://www.engagebay.com/integrations/learndash-integration 13 13 * Description: Sync course enrollments with EngageBay to automate emails, track learner progress, and boost engagement through smart workflows 14 * Version: 1. 014 * Version: 1.1 15 15 * Requires at least: 5.2 16 16 * Requires PHP: 7.4 -
engagebay-add-on-for-learndash/trunk/includes/admin/class-engagebay-payment-gateway.php
r3324935 r3328198 33 33 $course = get_post( $course_id ); 34 34 35 $pricing_info = json_decode( $object['metadata']['pricing_info'], true);35 $pricing_info = json_decode( $object['metadata']['pricing_info'], true ); 36 36 37 $data = [37 $data = [ 38 38 'course' => [ 39 39 'id' => $course_id, … … 47 47 ]; 48 48 49 file_put_contents("payment.json",json_encode($event, JSON_PRETTY_PRINT)); 49 $course_details = [ 50 'user_id' => $object['metadata']['user_id'], 51 'course_id' => $course_id, 52 'course_title' => $course->post_title, 53 'url' => get_permalink( $course->ID ), 54 'price' => get_post_meta( $course->ID, '_ld_price', true ) 55 ]; 50 56 51 57 EngageBay_LearnDash_Api::trigger_event( EngageBay_LearnDash_Preferences_Section::COURSE_PURCHASED, $data ); 58 EngageBay_LearnDash_Api::trigger_event( EngageBay_LearnDash_Preferences_Section::NEW_ENROLMENT, $course_details, $course->post_title ); 52 59 } 53 60 } -
engagebay-add-on-for-learndash/trunk/includes/api/class-engagebay-learndash-api.php
r3324935 r3328198 17 17 18 18 private const BASE_API_URL = 'https://app.engagebay.com/dev/api/panel'; 19 // private const BASE_API_URL = 'https://app-dot-alpha3-dot-accountbox-154605.appspot.com/dev/api/panel';20 19 21 20 public function validate_rest_api_key( $rest_api_key ) { … … 68 67 ]; 69 68 70 $current_user = wp_get_current_user();71 72 69 if ( $event === EngageBay_LearnDash_Preferences_Section::USER_CREATED ) { 73 70 $actions = [ 'create_contact' ]; 74 $current_user = get_user( $payload['user_id'] );75 71 } else if ( $event === EngageBay_LearnDash_Preferences_Section::USER_UPDATED ) { 76 72 $actions = [ 'update_contact' ]; 77 $current_user = get_user( $payload['user_id'] );78 73 } else if ( $event === EngageBay_LearnDash_Preferences_Section::COURSE_COMPLETED 79 74 || $event === EngageBay_LearnDash_Preferences_Section::LESSON_COMPLETED … … 82 77 || $event === EngageBay_LearnDash_Preferences_Section::COURSE_PURCHASED ) { 83 78 $actions = [ ...$actions, 'update_deal' ]; 84 if (isset($payload['user_id'])) {85 $current_user = get_user($payload['user_id']);86 }87 79 } 88 80 … … 92 84 93 85 $additionalInfo = self::prepare_additional_info( $event, $actions, $payload, $name ); 86 87 $current_user = wp_get_current_user(); 88 if (isset($payload['user_id']) && get_user($payload['user_id'])) { 89 $current_user = get_user($payload['user_id']); 90 } 94 91 95 92 $payload = array_merge( … … 114 111 ); 115 112 116 file_put_contents( "payload.json", json_encode( $payload, JSON_PRETTY_PRINT ), FILE_APPEND );117 118 113 $response = wp_remote_post( $url, [ 119 114 'headers' => $headers, … … 121 116 ] ); 122 117 123 $response_code = wp_remote_retrieve_response_code( $response );118 // $response_code = wp_remote_retrieve_response_code( $response ); 124 119 $result = wp_remote_retrieve_body( $response ); 125 if ( $response_code !== 200 ) {126 file_put_contents( "error.json", $result, FILE_APPEND );127 }128 129 file_put_contents( "response.json", json_encode( [130 'url' => $url,131 'payload' => $payload,132 'headers' => $headers,133 'status_code' => $response_code,134 'result' => $result135 ], JSON_PRETTY_PRINT ), FILE_APPEND );120 // if ( $response_code !== 200 ) { 121 // file_put_contents( "error.json", $result, FILE_APPEND ); 122 // } 123 // 124 // file_put_contents( "response.json", json_encode( [ 125 // 'url' => $url, 126 // 'payload' => $payload, 127 // 'headers' => $headers, 128 // 'status_code' => $response_code, 129 // 'result' => $result 130 // ], JSON_PRETTY_PRINT ), FILE_APPEND ); 136 131 } 137 132 … … 214 209 $response = wp_remote_request( $url, [ 'headers' => $headers ] ); 215 210 216 $response_code = wp_remote_retrieve_response_code( $response );211 // $response_code = wp_remote_retrieve_response_code( $response ); 217 212 $result = wp_remote_retrieve_body( $response ); 218 if ( $response_code !== 200 ) {219 file_put_contents( "error_fields.json", $result, FILE_APPEND );220 }213 // if ( $response_code !== 200 ) { 214 // file_put_contents( "error_fields.json", $result, FILE_APPEND ); 215 // } 221 216 222 217 return json_decode( $result, true ); -
engagebay-add-on-for-learndash/trunk/includes/class-engagebay-learndash.php
r3324935 r3328198 159 159 ), 10, 0 ); 160 160 161 //add_action('learndash_payment_gateway_event_processed', array(162 //$this->engagebay_learndash_payment_gateway,163 //'payment_processed',164 //), 10, 3);161 add_action('learndash_payment_gateway_event_processed', array( 162 $this->engagebay_learndash_payment_gateway, 163 'payment_processed', 164 ), 10, 3); 165 165 } 166 166 } -
engagebay-add-on-for-learndash/trunk/includes/events/class-engagebay-learndash-course.php
r3324935 r3328198 34 34 ]; 35 35 36 EngageBay_LearnDash_Api::trigger_event( EngageBay_LearnDash_Preferences_Section::NEW_ENROLMENT, $course_details, $course->post_title ); 36 $courseFee = get_post_meta($course->ID, '_ld_price_type', true); 37 38 if ($courseFee === 'free') { 39 EngageBay_LearnDash_Api::trigger_event( EngageBay_LearnDash_Preferences_Section::NEW_ENROLMENT, $course_details, $course->post_title ); 40 } 37 41 } 38 42 -
engagebay-add-on-for-learndash/trunk/includes/settings/class-engagebay-learndash-preferences-section.php
r3324935 r3328198 118 118 echo '<div class="engagebay-ld-preferences-action-group">'; 119 119 foreach ( $group['values'] as $key => $label ) { 120 if ( $key == 'update_contact_field' || $key == 'create_tag' || $key == 'create_task' ) {120 if ( $key == 'update_contact_field' || $key == 'create_tag' || $key == 'create_task' || $key == 'create_contact_and_deal' ) { 121 121 switch ( $group_key ) { 122 case self::NEW_ENROLMENT: 122 123 case self::COURSE_COMPLETED: 123 124 case self::QUIZ_COMPLETED: … … 139 140 case self::ESSAY_SUBMITTED: 140 141 if ($key === 'update_contact_field' || $key === 'update_deal_field') { 141 $label_width = 'width- 20';142 $label_width = 'width-30'; 142 143 } else { 143 144 $label_width = null; -
engagebay-add-on-for-learndash/trunk/readme.txt
r3325582 r3328198 1 1 === EngageBay Marketing Automation for LearnDash === 2 2 Contributors: engagebay 3 Tags: engagebay, learndash, crm, automation, marketing3 Tags: engagebay, learndash, marketing automation, crm integration, email marketing, student engagement, course automation 4 4 Requires at least: 5.2 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 Plugin URI: https://engagebay.com/learndash 11 11 12 Seamlessly connect LearnDash with EngageBay CRM. Automatically sync students, apply tags, and trigger marketing workflows based on course activity.12 Effortlessly connect LearnDash with EngageBay CRM to supercharge student engagement. Automate email campaigns, segment users by course activity, and trigger workflows with zero manual work. 13 13 14 14 == Description == 15 Connect your LearnDash LMS courses with EngageBay CRM effortlessly. 16 Automatically sync students, trigger marketing automations, and boost engagement with zero manual work. 15 16 **Streamline Your Course Marketing with EngageBay + LearnDash Integration** 17 Connect your LearnDash LMS with EngageBay CRM and automate your entire student lifecycle — from enrollment to course completion. 18 19 This plugin enables seamless syncing of LearnDash user data with EngageBay, allowing you to: 20 21 - Auto-enroll contacts into marketing lists 22 - Apply tags based on course progress 23 - Trigger email workflows based on enrollment, completion, or quiz results 24 - Segment learners for advanced targeting 25 - Eliminate manual exports and integrations 26 27 Ideal for course creators, marketers, and education businesses using LearnDash and EngageBay to grow faster. 28 29 == Features == 30 31 * 🔄 Auto-sync LearnDash students to EngageBay CRM 32 * 🏷️ Apply tags based on enrollment, completion, or quiz scores 33 * 📨 Trigger email campaigns or automations inside EngageBay 34 * 🗂️ Segment users based on course behavior and status 35 * 🚀 100% no-code setup and runs automatically in the background 36 * 🔐 Secure API-based connection to EngageBay 17 37 18 38 == Installation == 19 1. Navigate to **Plugins → Add New** in your WordPress dashboard. 20 2. Search for "**EngageBay Add-on for LearnDash**." 21 3. Click **Install Now** and then **Activate**. 22 4. Go to **LearnDash LMS → Settings -> EngageBay** to configure your API settings & Preferences. 39 40 1. Go to **Plugins → Add New** in your WordPress dashboard. 41 2. Search for "**EngageBay Marketing Automation for LearnDash**" 42 3. Click **Install Now** and then **Activate** 43 4. Navigate to **LearnDash LMS → Settings → EngageBay** to enter your EngageBay API keys and configure preferences 23 44 24 45 == How to Use == 25 1. Enter your EngageBay API Public Key and Private Key in the settings page. 26 2. Choose preferences of your choice to trigger EngageBay actions. 27 3. Set up actions like tagging, list assignments, or CRM field updates. 28 4. Build automations inside EngageBay based on synced data. 29 5. Watch your user engagement grow automatically! 46 47 1. Enter your EngageBay Private API Key on the settings page 48 2. Choose your sync preferences (trigger on enrollment, completion, quiz, etc.) 49 3. Define tags or CRM updates to send 50 4. Create automations inside EngageBay based on those tags or events 51 5. Sit back and watch your user engagement grow automatically! 30 52 31 53 == Frequently Asked Questions == 32 54 33 55 = Do I need an EngageBay account? = 34 Yes , you must have an EngageBay CRM account to use this plugin.56 Yes. A free or paid EngageBay CRM account is required. Sign up at [https://engagebay.com](https://engagebay.com) 35 57 36 = Does this work only with LearnDash? =37 Yes, this plugin is specifically designedfor LearnDash LMS.58 = Does this work with other LMS plugins? = 59 No. This integration is built specifically for LearnDash LMS. 38 60 39 = Can I automate email campaigns based on course activity? = 40 Absolutely! You can trigger EngageBay automations when a user enrolls or completes a course. 61 = Can I trigger email campaigns automatically when students complete a course? = 62 Yes! You can use completion-based triggers to launch email workflows or CRM automations. 63 64 = What student activities can be tracked or synced? = 65 Enrollments, course completions, quiz completions, and more — depending on how you configure the plugin. 66 67 = Is coding required? = 68 Not at all. Everything is handled via your WordPress admin dashboard with simple settings. 41 69 42 70 == Screenshots == 43 1. Auto sync learners 44 2. Progress based email automation 45 3. Segmentation 46 4. Campaigns 47 5. Notes 48 6. Quiz-Completed 71 72 1. Auto-sync learners to EngageBay CRM 73 2. Trigger emails based on progress 74 3. Smart segmentation for better targeting 75 4. Campaign automation from EngageBay 76 5. Add notes to contact profiles 77 6. Quiz-completed actions for deeper automation 49 78 50 79 == Changelog == 51 = 1.0.0 =52 * Initial release — connect LearnDash with EngageBay CRM and automate your student journey.53 80 54 == Upgrade Notice == 55 = 1.0.0 = 56 First release — install fresh and start automating your LearnDash courses. 81 = 1.1 = 82 * Added feature for paid courses to sync as deals in EngageBay
Note: See TracChangeset
for help on using the changeset viewer.