Nope, not working again. I create a folder of same name”remove-signup” and file of “remove-signup.plugin.PHP” and installed it through plugins screen.
But still the emails won’t stop, I tried creating another file in the dropins folder with only this function and that didn’t work too.
You need to login in order to like this post: click here
Maybe in 6.2.11, it is not being called soon enough. Remove it from dropin and create a new plugin (remove-signup.plugin.php) and see if that works:
<?php if (!defined('BASE_PATH')) exit('No direct script access allowed'); /* * Plugin Name: Remove Signup Emails * Plugin URI: https://www.edutracsis.com/forums/topic/can-automated-account-login-emails-be-stopped-temporarily/ * Version: 1.0.0 * Description: Stops signup emails from sending. * Author: Joshua Parker * Author URI: https://www.edutracsis.com/ * Plugin Slug: remove-signup */ $app = \Liten\Liten::getInstance(); function remove_login_email_details($message = '', $headers = '', $email = '', $id = '', $username = '', $password = '', $host = '') { return false; } $app->hook->add_filter('myedutrac_appl_confirm', 'remove_login_email_details', 99, 7);
Joshua Parker
Twitter | Facebook | DigitalOcean | tinyCampaignYou need to login in order to like this post: click here
Yes, there are other that run in the same file, they are working fine.
<?php if (!defined('BASE_PATH')) exit('No direct script access allowed'); $app = \Liten\Liten::getInstance(); /*function pps_exists($pps) { if ($person = get_person_by('pps', $pps)) { return $person->personID; } return false; }*/ function etsis_get_country_name($iso2) { $app = \Liten\Liten::getInstance(); $cntry = $app->db->country() ->where('iso2 = ?', $iso2) ->findOne(); return _h($cntry->short_name); } function etsis_get_county_name($ID) { $app = \Liten\Liten::getInstance(); $cnty = $app->db->county() ->where('ID = ?', $ID) ->findOne(); return _h($cnty->name); } function etsis_get_county_name1($code) { $app = \Liten\Liten::getInstance(); $cnty = $app->db->county() ->where('code = ?', $code) ->findOne(); return _h($cnty->name); } function etsis_get_nationality($code) { $app = \Liten\Liten::getInstance(); $nation = $app->db->nationality() ->where('code = ?', $code) ->findOne(); return _h($nation->citizenof); } /*function dashboard_newperson_application() { $link = '<li'.ae('add_person').'><a href="' . get_base_url() . 'nae/addperson/">' . _t('(APER) Add Person') . '</a></li>'; echo $link; } $app->hook->{'add_action'}('main_nav_middle', 'dashboard_newperson_application', 5); */ function dashboard_newappl_application() { $link = '<li><a href="' . get_base_url() . 'online-app/" class="glyphicons user_add"><i></i>'._t( 'Online-Application' ).'</a></li>'; echo $link; } $app->hook->{'add_action'}('main_nav_middle', 'dashboard_newappl_application', 5); function etsis_get_sacp($stuID, $field) { $app = \Liten\Liten::getInstance(); $sacp = $app->db->student() ->setTableAlias('stu') ->select('b.*') ->_join('stu_program', 'stu.stuID = c.stuID', 'c') ->_join('acad_program', 'c.acadProgCode = b.acadProgCode', 'b') ->where('stu.stuID = ?', $stuID) ->orderBy('b.startDate', 'DESC') ->findOne(); return $sacp->$field; } /*function save_pps_pre() { $app = \Liten\Liten::getInstance(); /** * Double check to make sure that a particular * username does not exist. If it does, return false. $count = $app->db->person()->where( 'pps = ?', $app->req->_post('pps') )->count('personID'); if($count > 1) { $app->flash( 'error_message', sprintf( _t( 'The PPS %s already exists please check for old records.' ), $app->req->_post('pps') ) ); redirect($app->req->server['HTTP_REFERER']); return; } } $app->hook->add_action('pre_save_person', 'save_pps_pre', 10); */ function remove_login_email_details($message='',$headers='',$email='',$id='',$username='',$password='',$host='') { return false; } $app->hook->add_filter('myedutrac_appl_confirm', 'remove_login_email_details', 99, 7);
I attached the file in case if the above code display is not file, please find the attachment
You need to login in order to like this post: click here
Then it should work. You’ve added this to a dropin which calls the global $app variable?
<?php $app = \Liten\Liten::getInstance();
Joshua Parker
Twitter | Facebook | DigitalOcean | tinyCampaignYou need to login in order to like this post: click here
You mean in the app/src/Core/etsis_Email.php
public function myetRegConfirm($email, $id, $username, $password, $host) { $sitename = strtolower($_SERVER['SERVER_NAME']); if (substr($sitename, 0, 4) == 'www.') { $sitename = substr($sitename, 4); } $name = get_name($id); $site = _t('myeduTrac::') . _h(get_option('institution_name')); $message = "<p>Hello $name:</p> <p>Below are your login details. Keep this email for future reference.</p> <p><strong>Username:</strong> $username</p> <p><strong>Password:</strong> $password</p> <p>$host</p> <p>Thank You</p> <p>Administrator<br /> ______________________________________________________<br /> THIS IS AN AUTOMATED RESPONSE.<br /> ***DO NOT RESPOND TO THIS EMAIL****</p> "; $headers = "From: $site <auto-reply@$sitename>\r\n"; $headers .= "X-Mailer: PHP/" . phpversion(); $headers .= "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $this->etsis_mail($email, _h(get_option('institution_name')) . _t(" Account Login Details"), $message, $headers); return $this->app->hook->apply_filter('myedutrac_appl_confirm', $message, $headers); }
or in the myet.router.php
$app->hook->do_action('post_save_myet_appl', $nae); $app->flash('success_message', _t('Your application has been submitted, and you can now log in with your username and password.')); etsis_logger_activity_log_write('New Record', _t('Student Application Via myeT'), get_name($ID) . ' (' . _trim($_POST['acadProgCode']) . ')', _trim($_POST['uname'])); $email->myetRegConfirm(_trim($_POST['email']), $ID, _trim($_POST['uname']), $_POST['password'], get_base_url()); $email->myetApplication($ID, get_base_url()); redirect(get_base_url() . 'online-app' . '/'); } else { $app->flash('error_message', $flashNow->notice(409)); redirect($app->req->server['HTTP_REFERER']);
I think they are fine i double checked the class name, it should be myedutrac_appl_confirm.
You need to login in order to like this post: click here
What is the name of the filter being used in the myetRegConfirm class method.
Joshua Parker
Twitter | Facebook | DigitalOcean | tinyCampaignYou need to login in order to like this post: click here
It’s not working for 6.2.11 edition, but it’s working fine for 6.3.0.
function remove_login_email_details($message='',$headers='',$email='',$id='',$username='',$password='',$host='') { return false; } $app->hook->add_filter('myedutrac_appl_confirm', 'remove_login_email_details', 99, 7);
You need to login in order to like this post: click here
You can use the same code but change myetsis_appl_confirm to myedutrac_appl_confirm.
Joshua Parker
Twitter | Facebook | DigitalOcean | tinyCampaignYou need to login in order to like this post: click here
That’s working good, So can I use the same code in 6.2.11 or should I use the previous?
function remove_login_email_details($message = null, $headers = null)
{
return false;
}
$app->hook->add_filter(‘myedutrac_appl_confirm’, ‘remove_login_email_details’, 10, 2);- This reply was modified 3 years, 8 months ago by
Teja Majety.
You need to login in order to like this post: click here
I missed a few variables in the function but the filter has been renamed in 6.3.0 RC2. So if you are testing with 6.3.0 RC2, then try the function below:
function remove_login_email_details($message='',$headers='',$email='',$id='',$username='',$password='',$host='') { return false; } $app->hook->add_filter('myetsis_appl_confirm', 'remove_login_email_details', 99, 7);
Joshua Parker
Twitter | Facebook | DigitalOcean | tinyCampaignYou need to login in order to like this post: click here
Nope, the emails are fine.
Actaully I am trying this with the pilot edition which consists 6.3.0 RC2 edutrac edition. I thought the functions should work same in both versions 6.2.11 and 6.3.0.
Should I try this with stable edition?
Please find the attachments of the email that I received after the application is successfully submitted
Attachments:
You must be logged in to view attached files.You need to login in order to like this post: click here
Was the message of the email blank?
Joshua Parker
Twitter | Facebook | DigitalOcean | tinyCampaignYou need to login in order to like this post: click here
Still, the emails are going to applicants.
I copied it with all the other function that I have in the dropins folder. So if the other functions are working this should work as well.
You need to login in order to like this post: click here
function remove_login_email_details($message = null, $headers = null) { return false; } $app->hook->add_filter('myedutrac_appl_confirm', 'remove_login_email_details', 10, 2);
- This reply was modified 3 years, 8 months ago by
Joshua Parker. Reason: Forgot to add priority and accepted arguments
Joshua Parker
Twitter | Facebook | DigitalOcean | tinyCampaignYou need to login in order to like this post: click here
Is it possible to stop the automated emails, when an application is made from the myeduTrac self-service portal, an automated mail goes to student and admin, can we stop the email that’s going to student temporarily?
I tried to add a filter in the dropins folder but that doesn’t stop the emails, Is there anything that I can do to temporarily stop the emails?
function remove_login_email_details()
{
return false;
}
$app->hook->add_filter(‘myetRegConfirm’, ‘remove_login_email_details’);You need to login in order to like this post: click here
- This reply was modified 3 years, 8 months ago by
The topic ‘Can automated account login emails be stopped temporarily’ is closed to new replies.