Home › Forums › Legacy Support › Support queries › Other issues › email activation not sending due to custom code
Tagged: activation email
- This topic has 8 replies, 3 voices, and was last updated 5 years, 10 months ago by
Mk.
Viewing 9 posts - 1 through 9 (of 9 total)
-
AuthorPosts
-
May 16, 2019 at 6:35 am #209328
blugenes
SpectatorCan you please help with assistance, the website is live and you guys are not responding please help students are registering and not receiving any emails to activate their account and and when i go to all users -> pending -> choose user and then try to send the mail again then i get this error: The site is experiencing technical difficulties. Please check your site admin email inbox for instructions. and i got this email aswell: Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email. In this case, WordPress caught an error with your theme, WPLMS Blank ChildTheme. First, visit your website (https://aldestraining.co.za/) and check for any visible issues. Next, visit the page where the error was caught (https://aldestraining.co.za/wp-admin/users.php?page=bp-signups&action=do_resend&signup_ids=76&_wpnonce=f3ce8f95aa) and check for any visible issues. An error of type E_ERROR was caused in line 95 of the file /var/www/web/wplive.aldestraining.co.za/wp-content/themes/wplmsblankchildhtheme/functions.php. Error message: Cannot use object of type BP_Email as array this is the code on that line: add_action('bp_send_email',function($args){ if($args[1] == 'student_course_subscribed'){ if(!empty($args[3]) && !empty($args[3]['tokens']) && !empty($args[3]['tokens']['course.name'])){ global $wpdb; $course_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type='course'", $args[3]['tokens']['course.name'] ) ); if(!empty($course_id)){ if(has_term(‘insurance-courses’,’course-cat’,$course_id) || has_term(‘e-learning-courses’,’course-cat’,$course_id)){ $args[0]->set_cc('lynessa@ialearn.co.za'); } } } } });May 16, 2019 at 6:38 am #209330blugenes
SpectatorThis reply has been marked as private.May 16, 2019 at 6:42 am #209332blugenes
Spectatoralso i removed the custom code for now as everything works once i delete the codeMay 16, 2019 at 1:56 pm #209439Mk
Moderatoralso i removed the custom code for now as everything works once i delete the code
So your issue is solved or not? if not what do you want, actually I am not getting you ?May 17, 2019 at 7:29 am #209543blugenes
Spectatorno it is not solved, i need that code in there, i just took it out because the website is live and with that code there the students dont get emails, but i need that code in there and the emails to workMay 18, 2019 at 7:16 am #209697Anshuman Sahu
Keymasterchecking....May 18, 2019 at 7:47 am #209700Anshuman Sahu
KeymasterOkay found some mistakes in code and corrected it and tested it .It works without errors but did not checked if email arrived or not . updated code is : add_action('bp_send_email',function($args){ if($args[2] == 'student_course_subscribed'){ if(!empty($args[4]) && !empty($args[4]['tokens']) && !empty($args[4]['tokens']['course.name'])){ global $wpdb; $course_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type='course'", $args[4]['tokens']['course.name'] ) ); if(!empty($course_id)){ if(has_term('insurance-courses','course-cat',$course_id) || has_term('e-learning-courses','course-cat',$course_id)){ $args[0]->set_cc('lynessa@ialearn.co.za'); } } } } });May 19, 2019 at 9:17 am #209788blugenes
SpectatorThank you i will check and let you knowMay 20, 2019 at 10:04 am #209884Mk
Moderatorok. -
AuthorPosts
Viewing 9 posts - 1 through 9 (of 9 total)
- The topic ‘email activation not sending due to custom code’ is closed to new replies.