Guest User

Untitled

a guest
Jan 19th, 2019
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. MAIL_DRIVER=smtp
  2. MAIL_HOST=smtp.gmail.com
  3. MAIL_PORT=587
  4. MAIL_USERNAME=mygmail@gmail.com
  5. MAIL_PASSWORD=mypassword
  6. MAIL_ENCRYPTION=tls
  7.  
  8. <?php
  9.  
  10. namespace AppHttpControllersJobs;
  11.  
  12. require app_path().'/../../../lib/vendor/autoload.php';
  13. include_once(app_path().'/../../../lib/utils.php');
  14. use SymfonyComponentHttpKernelExceptionHttpException;
  15. use IlluminateRoutingResponseFactory;
  16. use IlluminateDatabaseQueryBuilder;
  17. use IlluminateSupportFacadesInput;
  18. use AppHttpControllersController;
  19. use IlluminateSupportFacadesView;
  20. use AppModelsJobsJobExperience;
  21. use AppModelsJobsJobSalary;
  22. use AppModelsJobsJobTitle;
  23. use AppModelsJobsJobDetails;
  24. use AppModelsJobsJobApply;
  25. use AppModelsJobsModuleItems;
  26. use IlluminateHttpResponse;
  27. use IlluminateHttpRequest;
  28. use CarbonCarbon;
  29. use Validator;
  30. use Config;
  31. use File;
  32. use DB;
  33. use Mail;
  34.  
  35. class AppJobsController extends Controller
  36. {
  37. public function jobApply(Request $request)
  38. {
  39. $JobApply = new JobApply;
  40. $JobApply->job_id = $request->job_id;
  41. $JobApply->attachment = $images[0];
  42. $JobApply->user_id = $this->user['uid'];
  43. if ($JobApply->save())
  44. {
  45. $jobDetails = JobDetails::find($request->job_id);
  46. $JobTitle = JobTitle::find($jobDetails->jobtitle_id);
  47.  
  48. $content = array(
  49. 'JobTitle' => $JobTitle->title,
  50. 'CompanyName' => $jobDetails->company_name,
  51. 'postedDate' => date('d-m-Y', strtotime($jobDetails->created_at)),
  52. 'user' => 'App User'
  53. );
  54.  
  55. $subject = 'Applying For '.$JobTitle->title;
  56.  
  57. $toUser = $jobDetails->email_id;
  58.  
  59. $pathToFile = $this->uploadlocation.'/'.$images[0];
  60.  
  61. Mail::send('email.sendResumes', $content, function ($message) use ($pathToFile, $toUser, $subject)
  62. {
  63. $message->from('noreply@gmail.com', 'Job Appy');
  64. $message->subject($subject);
  65. $message->to($toUser);
  66. });
  67. }
  68. }
  69. }
  70.  
  71. <div>
  72. I would like to apply for {{$JobTitle}} within your company {{$CompanyName}}, adversited in Thedal on {{$postedDate}}.<br><br>
  73.  
  74. I believe this position would provide a great opportunity to further my chosen career. My willingness to work hard and build my skill base will make me a good candidate for the job.<br><br>
  75.  
  76. I look forward to hearing from you at your convenience.<br><br>
  77.  
  78. Thanks & Regards,<br><br>
  79.  
  80. {{$user}}
  81. </div>
Add Comment
Please, Sign In to add comment