Okay
  Public Ticket #3557028
Email work flow
Closed

Comments

  • Alan Shires started the conversation

    Dear wpLMS,

    I recently purchased your product and have my modules going out once a week on drip. The entire course lasts 1 year. 

    The issue I am having is learners often forget they have a new module available so I really need the learner to be notified by email once a week from the time of purchase that a new module is available. 

    Additionally, Just being able to recap the last module and introduce the new module via this email chain is a good habit to get into. At the moment I am doing this manually but I was told when I purchased wpLMS that this functionality is available. 

    My students are making their purchases via woo commerce. 

    Presently, 1 automated welcome email goes out from wpLMS when a learner subscribes and 2 receipts from woo. That is all that is automated.

    Please can you advise how I would go about getting an email workflow implemented to my course/site?

    Best,
    Alan Shires
    The Voice Actor College

  • [deleted] replied

    yes this is available please goto wp-admin -> lms-> settings -> emails -> email schedule -> 

    Enable Drip Feed Email

  • Alan Shires replied

    Hi Alex,

    The developers have already tried what you have said but it doesn't work like I need. One of my modules consists of 7 units. The emails go out for each unit separately and the settings only allow emails to be sent this way.

    This results in multiple emails going out each week.

    Please advise.

  • [deleted] replied

    Well the email only goes for next unit which will be accessed by the user not for all 7 units . 


  • Alan Shires replied

    I think you are not understanding what I am saying so I have attached a screenshot.
    On the left-hand side, you can see 'The Basics' and 'Intro to Anime'. These are my modules. Each one consists of 7 units 'Intro, Exploration 1 and 2, Application, Resources, Quiz and Upon Completition'. 

    What I am trying to communicate with you is that the only way to make the emails work from our side is to send an email to each individual unit. Where as I want one to go out per module (At the moment it is going out at 7 per module).

    This is what we need to address.

    As its 24 hours between responses, I am wondering if we have other options to deal with this quicker. For example, maybe you could ask me for some information to help you understand why this is the case. Or perhaps we could organise a call?

    Attached files:  Untitled.jpg

  • [deleted] replied

    ok I get it now , the email will be sent for the first unit of each section then  . it wont send email for each unit of the section .

    it will skip next 6 units then again will send email for the 1st unit of second section after seven days .

    but for this to work you need to set drip feed section wise : 

    1882870026.png


  • Alan Shires replied

    Hi Alex,

    I have sent this to the developers to look at. 

    So with each module containing 7 units once a week what that means is after they complete one module (7 units) they then have to wait a week for the next module (With 7 units) to become available.

    Will this affect how I have the site set up with respect to the unit drip frequency? Or will this just specifically affect the email drip? 

    I am very happy with how the site is set up at the moment, once a week they get a new module (which has 7 units in it) The one thing I need is for a single automated email to go out each week opposed 7. 

    Best,
    Alan

  • Alan Shires replied

    The steps for the emails are not working as you described, instead, it continues to email per unit as opposed to per module. See attached our backend set up.

    Attached files:  backend.png

  • [deleted] replied

    yes you are right this will send email for each unit immediately for the 7 units but for the first unit of next module it will send it after 7 days / 

    this is an issue the unit drip does not follow for section drip feed.

    to fix this disable the email drip in lms settings and 

    add this code in your wplms-customizer.php file in wplms customizer plugin : 



    add_action('wplms_start_unit','schedule_drip_mail',10,5);
    add_action('wplms_send_drip_mail','wplms_send_drip_mail',10,3);
    function schedule_drip_mail($current_unit_id,$course_id,$user_id,$next_unit_id,$timestamp){ $drip_schedule = $schedule['drip_schedule'];
    $drip_schedule = $timestamp - 7*24*3600;
    $args = array($next_unit_id,$course_id,$user_id); wp_clear_scheduled_hook('wplms_send_drip_mail',array($current_unit_id,$course_id,$user_id));
    if(!wp_next_scheduled('wplms_send_drip_mail',$args))
    wp_schedule_single_event($drip_schedule,'wplms_send_drip_mail',$args);

    } function wplms_send_drip_mail($unit_id,$course_id,$user_id){
    if(class_exists('WPLMS_tips')){
            $wplms_settings = WPLMS_tips::init();
            $settings = $wplms_settings->lms_settings;
          }else{
            $settings = get_option('lms_settings');  
          } if(!empty($settings['schedule']))
    $schedule = $settings['schedule'];
        if(isset($schedule) && is_array($schedule)){
          if($schedule['drip'] === 'yes'){         $subject = $schedule['drip_subject'];
            $message = $schedule['drip_message'];
            $unit_title = get_the_title($unit_id);
            $course_title = get_the_title($course_id);
            $username = bp_core_get_user_displayname($user_id);     $subject = str_replace('{{unit}}',$unit_title,$subject);
            $message = str_replace('{{unit}}',$unit_title,$message);
            $subject = str_replace('{{course}}',$course_title,$subject);
            $message = str_replace('{{course}}',$course_title,$message);
            $subject = str_replace('{{user}}',$username,$subject);
            $message = str_replace('{{user}}',$username,$message);         $user = get_user_by('id',$user_id);       
            if(bp_course_is_member($course_id,$user_id)){
            bp_course_wp_mail($user->user_email,$subject,$message,array('action'=>'wplms_drip_mail','tokens'=> array('unit.name'=>$unit_title,'course.name'=>$course_title,'student.userlink'=>$username,'course.titlelink'=>'<a href="'.get_permalink($course_id).'">'.$course_title.'</a>')));
            }          wp_clear_scheduled_hook('wplms_send_drip_mail',array($unit_id,$course_id,$user_id));
        }
        }
    }

    How to add code in wplms customizer plugin

  • Alan Shires replied

    Will this need to be applied everytime there is an update?

  • [deleted] replied

    no sir .

  • Alan Shires replied

    One more question regarding Drip. 

    At the moment I have 52 modules which is 1 a week. This is of course spaced out with one week between each module. 

    The issue that I have is that the timer does not start until the previous module is completed. Can that be fixed? I do not want them to be able to access the next module without completing the previous modules, but I also don't want that to stall the timers.

    Example, 

    Let's say you enrolled on my course and completed module 1 immediately. But did not come back to the course for a further three weeks. At this point your hope would be to complete modules 2, 3 and 4 back to back. However, despite the three week wait, after completing module 2 you are then greeted by a 7-day timer before module 3 unlocks. 

  • [deleted] replied

    for this you need to enable  

    1907975507.png


  • Alan Shires replied

    In response to the code you shared below, my developers tried to implement it and it 'did not work'. 
    Perhaps you would be keen to try it on the dev site?

  •   Alan Shires replied privately
  • [deleted] replied

    Hi this will calculate the access to the unit from the time user started the course it needs the start course activity to be present to make it work . 

    Please check if that actiity is present for the user . 

    Calculate the days passed by when user started the course and how much modules he should have access to .

  • Alan Shires replied

    Hi Alex,

    Is this in response to the email code or the time toggle? We have two conversations going on inside of this thread now.

  • [deleted] replied

    this is in response to the email and drip feed content

  • Alan Shires replied

    Hi Alex,

    I am pleased to say the toggle works on the drip so that element has worked fortunately.

    However, I do require more support in respect to the automated emails. As you may recall, the issue we face is that the emails are going out per unit as opposed to per module. So initially that meant 7 emails within 7 seconds of each other. 

    My developers thought they had fixed this based on your direction and on the test account, they received one email for module 1. However I received 2. But for module 2 they received 2 emails and I received 4. So there is still something very wrong here.

    Can you advise? 
    Thanks

  • [deleted] replied

    hi you have to disable the drip schedule in the lms -> settings .

    and use this code only to send drip emails: