dimitris Posted August 23, 2011 Report 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
Jeff Posted August 24, 2011 Report 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
dimitris Posted August 24, 2011 Author Report 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
Angel Air Posted August 24, 2011 Report 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
Connor1994 Posted December 24, 2011 Report Posted December 24, 2011 Is it possible to get a search box to look for the pilot instead of a drop down please? Quote
dimitris Posted December 24, 2011 Author Report 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
rpalmer800 Posted December 29, 2011 Report Posted December 29, 2011 UH, it like automatically logs me out when i go to the link.... Quote
Jeff Posted December 30, 2011 Report 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
rpalmer800 Posted December 30, 2011 Report Posted December 30, 2011 oh, Yes there it is.... Thank you very much Quote
tgycgijoes Posted April 26, 2012 Report Posted April 26, 2012 thank you very much for this it works great. Quote
StartVM Posted August 14, 2014 Report 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
Members Vangelis Posted August 18, 2014 Members Report Posted August 18, 2014 what do you want to do ? Quote
StartVM Posted August 19, 2014 Report Posted August 19, 2014 what do you want to do ? make the {PILOT_ID} {PILOT_FNAME} {PILOT_LNAME} functions work Quote
mseiwald Posted August 21, 2014 Report 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
Miggel Posted December 23, 2020 Report Posted December 23, 2020 Does anyone know how it works that "{PILOT_ID} {PILOT_FNAME} {PILOT_LNAME}" this system works? Quote
Administrators ProAvia Posted December 23, 2020 Administrators Report 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
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.