dimitris Posted August 23, 2011 Report Share Posted August 23, 2011 Email individual pilot. Current version: v1 Tested on: 2.1.93 Email individual pilot is a module that allow you to send a mail a a certain pilot to his email address from inside the phpVMS admin panel. Installation: 1. Upload mailer_mailpilot_form.tpl to your /admin/templates folder on ftp. 2. Insert the following lines at your MassMailer.php file located at /modules/MassMailer on your ftp. #------------Individual Pilot Mailing------------------------------------------------------------ #Copyrights dimitris phpvms forum public function mail_pilot() { $this->render('mailer_mailpilot_form.tpl'); } public function sendmail_pilot(){ echo '<h3>Sending email...</h3>'; if($this->post->subject == '' || trim($this->post->message) == '') { $this->set('message', 'You must enter a subject and message!'); $this->render('core_error.tpl'); return; } $subject = DB::escape($this->post->subject); $emailp = DB::escape($this->post->email_pilot); $message = stripslashes($this->post->message). PHP_EOL . PHP_EOL; $message = str_replace('<br>', '<br />', $message); Util::SendEmail($emailp, $subject, $message); echo 'Completed! Email sent.'; LogData::addLog(Auth::$userinfo->pilotid, 'Sent a private mail'); return; } #---------------------------------------------------------------------------------------------- 3. Save and close MassMailer.php and upload to your site. 4. Navigate to " www.yoursite.com/admin/index.php/massmailer/mail_pilot " and test it. Note: This is my first admin side module. For any problems please report. Thanks! mailer_mailpilot_form.zip 6 Quote Link to comment Share on other sites More sharing options...
Jeff Posted August 24, 2011 Report Share Posted August 24, 2011 Parse error: syntax error, unexpected T_PUBLIC in /home/virtualf/public_html/admin/modules/MassMailer/MassMailer.php on line 109 Am I supposed to replace something? If I were to paste this at the ent of the original .php file, I get that error. Line 109 is the start of your code above. Quote Link to comment Share on other sites More sharing options...
dimitris Posted August 24, 2011 Author Report Share Posted August 24, 2011 I type it wrong sorry... Place the lines under the public function index() { $this->set('allgroups', PilotGroups::getAllGroups()); $this->render('mailer_form.tpl'); } and above the public function sendmail() { echo '<h3>Sending email</h3>'; if($this->post->subject == '' || trim($this->post->message) == '') { $this->set('message', 'You must enter a subject and message!'); $this->render('core_error.tpl'); return; } So it will look like this: http://pastebin.com/B4XRWg6y Quote Link to comment Share on other sites More sharing options...
Angel Air Posted August 24, 2011 Report Share Posted August 24, 2011 worked first time Thanks great add-on!!! I also added a link to the admin centre so you can access the feature from within the admin centre. just add "Email individual pilots" and make it a link " www.yoursite.com/admin/index.php/massmailer/mail_pilot " to Admin/templates/core_navigation.tpl which will take you straight to it from within the admin centre. Scott Quote Link to comment Share on other sites More sharing options...
Jeff Posted August 24, 2011 Report Share Posted August 24, 2011 Thanx dimitris, it works now. +1 Quote Link to comment Share on other sites More sharing options...
Connor1994 Posted December 24, 2011 Report Share Posted December 24, 2011 Is it possible to get a search box to look for the pilot instead of a drop down please? Quote Link to comment Share on other sites More sharing options...
dimitris Posted December 24, 2011 Author Report Share Posted December 24, 2011 Yes it is You need a textbox and some javascript/jquery code to search the MySQL table. I m not familiar with this type of coding... I m sorry but I can't help with this, anybody else is welcomed to edit the module Thanks! Quote Link to comment Share on other sites More sharing options...
Connor1994 Posted December 24, 2011 Report Share Posted December 24, 2011 I hope so! Quote Link to comment Share on other sites More sharing options...
rpalmer800 Posted December 29, 2011 Report Share Posted December 29, 2011 UH, it like automatically logs me out when i go to the link.... Quote Link to comment Share on other sites More sharing options...
Jeff Posted December 30, 2011 Report Share Posted December 30, 2011 Double check your link. It should look like this <li><a href="<?php echo adminurl('/massmailer/mail_pilot'); ?>">Email Individual Pilot</a></li> Quote Link to comment Share on other sites More sharing options...
rpalmer800 Posted December 30, 2011 Report Share Posted December 30, 2011 oh, Yes there it is.... Thank you very much Quote Link to comment Share on other sites More sharing options...
tgycgijoes Posted April 26, 2012 Report Share Posted April 26, 2012 thank you very much for this it works great. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted May 17, 2012 Report Share Posted May 17, 2012 Works perfect, ty Quote Link to comment Share on other sites More sharing options...
StartVM Posted August 14, 2014 Report Share Posted August 14, 2014 I realize this is an old thread, but how can I make the {PILOT_ID} {PILOT_FNAME} {PILOT_LNAME} functions work with this? Quote Link to comment Share on other sites More sharing options...
StartVM Posted August 18, 2014 Report Share Posted August 18, 2014 bump Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted August 18, 2014 Members Report Share Posted August 18, 2014 what do you want to do ? Quote Link to comment Share on other sites More sharing options...
StartVM Posted August 19, 2014 Report Share Posted August 19, 2014 what do you want to do ? make the {PILOT_ID} {PILOT_FNAME} {PILOT_LNAME} functions work Quote Link to comment Share on other sites More sharing options...
mseiwald Posted August 21, 2014 Report Share Posted August 21, 2014 I doubt that these are functions. I think they are just replaced in the module before the mail is sent. With str_replace for example. Quote Link to comment Share on other sites More sharing options...
Miggel Posted December 23, 2020 Report Share Posted December 23, 2020 Does anyone know how it works that "{PILOT_ID} {PILOT_FNAME} {PILOT_LNAME}" this system works? Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted December 23, 2020 Administrators Report Share Posted December 23, 2020 Through the coding, those variables pull the pilots ID, first name and last name to be placed into the email. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.