Skip to content

Commit d1387aa

Browse files
committedAug 9, 2016
latest changes
1 parent 5b8c730 commit d1387aa

File tree

1,836 files changed

+305458
-247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,836 files changed

+305458
-247
lines changed
 

‎app/Console/Commands/Wish.php

+19-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Wish extends Command
1515
*
1616
* @var string
1717
*/
18-
protected $signature = 'send:wishes';
18+
protected $signature = 'kanak:wishes';
1919

2020
/**
2121
* The console command description.
@@ -43,27 +43,39 @@ public function __construct(Mailer $mailer)
4343
public function handle()
4444
{
4545
$dateToday = date('Y-m-d');
46-
$users = \App\Models\Employee::whereRaw("DATE_FORMAT(`dob`, '%m-%d') = DATE_FORMAT('$dateToday', '%m-%d')")->with('user')->get();
47-
$emps = \App\Models\Employee::whereRaw("DATE_FORMAT(`doj`, '%m-%d') = DATE_FORMAT('$dateToday', '%m-%d')")->with('user')->get();
46+
$users = \App\Models\Employee::whereRaw("DATE_FORMAT(`date_of_birth`, '%m-%d') = DATE_FORMAT('$dateToday', '%m-%d')")->with('user')->get();
47+
$emps = \App\Models\Employee::whereRaw("DATE_FORMAT(`date_of_joining`, '%m-%d') = DATE_FORMAT('$dateToday', '%m-%d')")->with('user')->get();
4848

4949

5050
foreach($users as $user)
5151
{
52+
$this->info('emp id '. $user->id);
53+
$this->info('emp user id '. $user->user_id);
54+
$this->info($user->user->email);
5255
//send an email
53-
$subject = " Happy Birthday $user->emp_name";
54-
$body= "Dear $user->emp_name, <br /> <br /> Digital Ip Insights wishes you a very happy birthday. Have fun and enjoy your day.<br /> <br /><img src='http://shetakesontheworld.com/wp-content/uploads/2012/01/shutterstock_59781901.jpg'> <br /><br /> Regards, <br /><br /> Digital Ip Insights Pvt. Ltd. ";
56+
$subject = " Happy Birthday $user->name";
57+
$body= "Dear $user->name, <br /> <br /> Digital IP Insights wishes you a very happy birthday. Have fun and enjoy your day.
58+
<br /> <br />
59+
<img src='http://shetakesontheworld.com/wp-content/uploads/2012/01/shutterstock_59781901.jpg'>
60+
<br /><br />
61+
Regards, <br /><br /> Digital Ip Insights Pvt. Ltd. ";
5562
$this->mailer->send('hrms.wishes.birthday', ['body' => $body], function($message) use($user, $subject)
5663
{
5764
$message->from('hr@dipi-ip.com', 'Digital IP Insights Pvt Ltd');
65+
5866
$message->to($user->user->email, $user->name)->subject($subject);
5967
});
6068
}
6169

6270
foreach($emps as $emp)
6371
{
6472
//send an email
65-
$subject = " Congratulations on Work Anniversary $emp->emp_name";
66-
$body= "Dear $emp->emp_name, <br /> <br /> Many congratulations for your work anniversary. Wish you loads of success for your future.<br /> <br /><img src='http://ak.imgag.com/imgag/product/postcards/3397536/550x400xgraphic1.jpg.pagespeed.ic.G_VtKZOtwJ.jpg'> <br /><br /> Regards, <br /><br /> Digital Ip Insights Pvt. Ltd. ";
73+
$subject = " Congratulations on Work Anniversary $emp->name";
74+
$body= "Dear $emp->name, <br /> <br /> Many congratulations for your work anniversary. Wish you loads of success for your future.
75+
<br /> <br />
76+
<img src='http://ak.imgag.com/imgag/product/postcards/3397536/550x400xgraphic1.jpg.pagespeed.ic.G_VtKZOtwJ.jpg'>
77+
<br /><br />
78+
Regards, <br /><br /> Digital Ip Insights Pvt. Ltd. ";
6779
$this->mailer->send('hrms.wishes.anniversary', ['body' => $body], function($message) use($emp, $subject)
6880
{
6981
$message->from('hr@dipi-ip.com', 'Digital IP Insights Pvt Ltd');

‎app/Http/Controllers/DownloadController.php

100644100755
File mode changed.

0 commit comments

Comments
 (0)
Please sign in to comment.