Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new joinees to portal via google sheets #3258

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a0e0bb5
added sub-menu for managing working staff type
Bahugunajii Jul 3, 2023
21da5fb
fixed CI checks
Bahugunajii Jul 3, 2023
b3ab724
fixed CI checks
Bahugunajii Jul 3, 2023
3fb0e68
:sparkles: Add new joinees to portal via google sheets
Bahugunajii Jul 7, 2023
ba16b01
:green_heart: Ci check fixes
Bahugunajii Jul 7, 2023
86110fb
added approval screen
Bahugunajii Jul 10, 2023
7d31bdb
approve joinee corresponding to their names
Bahugunajii Jul 10, 2023
42ae6ef
ci check fixes
Bahugunajii Jul 10, 2023
362a6c3
Mail to InfraTeam
Akshiteshnaithani Jul 10, 2023
6d1a4d0
Merge branch 'master' of https://github.com/coloredcow/portal into fe…
Akshiteshnaithani Jul 10, 2023
2baceaa
Merge branch 'feature/working-staff-management' of https://github.com…
Akshiteshnaithani Jul 11, 2023
8b6cf75
fix CI checks
Akshiteshnaithani Jul 11, 2023
84b5312
Merge branch 'master' of https://github.com/coloredcow/portal into fe…
Akshiteshnaithani Jul 11, 2023
d2fce82
Merge branch 'feature/onboarding-of-new-joinee-via-gsheet' of https:/…
Akshiteshnaithani Jul 11, 2023
5319a09
fix CI checks
Akshiteshnaithani Jul 11, 2023
02b6953
fix CI checks
Akshiteshnaithani Jul 11, 2023
7a84343
fix CI checks
Akshiteshnaithani Jul 11, 2023
e9659ef
fix CI checks
Akshiteshnaithani Jul 11, 2023
b106853
added changes
Bahugunajii Jul 11, 2023
e793070
Merge branch 'feature/onboarding-of-new-joinee-via-gsheet' of https:/…
Bahugunajii Jul 11, 2023
872c4e0
CI checkfix
Akshiteshnaithani Jul 11, 2023
db9978d
Fix merge confict
Akshiteshnaithani Jul 11, 2023
c332dfd
Fix the error for frist Employee
Akshiteshnaithani Jul 11, 2023
ceb2c09
Remove ninth-nebula
Akshiteshnaithani Jul 11, 2023
6102d26
Merge branch 'feature/onboarding-of-new-joinee-via-gsheet' of https:/…
Akshiteshnaithani Jul 11, 2023
e4d4fc5
mail to new joine
Akshiteshnaithani Jul 11, 2023
6499916
mail to new joine
Akshiteshnaithani Jul 11, 2023
742d116
Resolve confits
Akshiteshnaithani Jul 11, 2023
85348f2
Merge branch 'master' of https://github.com/coloredcow/portal into fe…
Bahugunajii Jul 12, 2023
5cf3112
Merge branch 'feature/onboarding-of-new-joinee-via-gsheet' of https:/…
Bahugunajii Jul 12, 2023
ff06027
feedbaks update
Akshiteshnaithani Jul 12, 2023
3c0b200
modified placeholder text
Bahugunajii Jul 12, 2023
f2b2b6d
feedbacks update
Akshiteshnaithani Jul 12, 2023
5de6d20
feedbacks update
Akshiteshnaithani Jul 13, 2023
7a16b8a
Merge pull request #3269 from ColoredCow/feature/3267/Send-email-to-I…
Bahugunajii Jul 13, 2023
3486553
added changes
Bahugunajii Jul 17, 2023
418a963
Merge branch 'feature/onboarding-of-new-joinee-via-gsheet' of https:/…
Bahugunajii Jul 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Modules/HR/Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
'primary' => env('HR_FOLLOWUP_EMAIL_PRIMARY', '[email protected]'),
'secondary' => env('HR_FOLLOWUP_EMAIL_SECONDARY', '[email protected]'),
],
'hr-infra-mail' => env('INFRA_SUPPORT_EMAIL', '[email protected]'),
'applicant_form-details' => [
'preferred_name' => 'Preferred Name',
'date_of_birth' => 'Date Of Birth',
Expand All @@ -230,4 +231,5 @@
'acc_number' => 'Account Number',
'ifsc_code' => 'IFSC Code',
],

];
39 changes: 39 additions & 0 deletions Modules/HR/Emails/BasicDetailsOfJoinee.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Modules\HR\Emails;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class BasicDetailsOfJoinee extends Mailable
{
use Queueable, SerializesModels;

public $joinneeMail;
public $joinneeName;

/**
* Create a new message instance.
*
* @return void
*/
public function __construct($joinneeMail, $joinneeName)
{
$this->joinneeMail = $joinneeMail;
$this->joinneeName = $joinneeName;
}

/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->from(config('mail.from.address'), config('mail.from.name'))
->subject('Subject: Request for Email Creation ')
->to($this->joinneeMail)
->view('hr::mail.basic-detail-of-joinee');
}
}
37 changes: 37 additions & 0 deletions Modules/HR/Emails/NewJoinerEmailForInfraTeam.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Modules\HR\Emails;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class NewJoinerEmailForInfraTeam extends Mailable
{
use Queueable, SerializesModels;

public $data;

/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data)
{
$this->data = $data;
}

/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->from(config('mail.from.address'), config('mail.from.name'))
->subject('Subject: Request for Email Creation ' . $this->data['name'])
->to(config('hr.hr-infra-mail'))
->view('hr::mail.infra-team');
}
}
43 changes: 43 additions & 0 deletions Modules/HR/Emails/RetainershipAgreement.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Modules\HR\Emails;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class RetainershipAgreement extends Mailable
{
use Queueable, SerializesModels;

public $name;
public $email;
public $fileName;

/**
* Create a new message instance.
*
* @return void
*/
public function __construct($name, $email, $fileName)
{
$this->name = $name;
$this->email = $email;
$this->fileName = $fileName;
}

/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->from(config('mail.from.address'), config('mail.from.name'))
->subject('Retainership Agreement - ' . $this->name)
->to($this->email)
->view('hr::mail.offer-letter-to-new-joinee')
->attach(storage_path('app/public/' . config('constants.hr.offer-letters-dir') . '/' . $this->fileName));
}
}
74 changes: 74 additions & 0 deletions Modules/HR/Http/Controllers/EmployeeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@
namespace Modules\HR\Http\Controllers;

use App\Services\EmployeeService;
use Google_Client;
use Google_Service_Sheets;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Mail;
use Modules\HR\Emails\BasicDetailsOfJoinee;
use Modules\HR\Emails\NewJoinerEmailForInfraTeam;
use Modules\HR\Entities\Assessment;
use Modules\HR\Entities\Employee;
use Modules\HR\Entities\HrJobDesignation;
use Modules\HR\Entities\HrJobDomain;
use Modules\HR\Entities\IndividualAssessment;
use Modules\HR\Entities\Job;
use Modules\Project\Entities\ProjectTeamMember;
use Modules\User\Entities\User;
use Modules\HR\Emails\RetainershipAgreement;
use niklasravnsborg\LaravelPdf\Facades\Pdf;

class EmployeeController extends Controller
{
Expand Down Expand Up @@ -144,4 +152,70 @@ public function updateEmployeeReviewers(Request $request, Employee $employee)

return redirect()->back();
}

public function showApprovalForm()
{
$client = new Google_Client();
$client->setAuthConfig('E:\Downloads\ninth-nebula-392106-8478ffdda8b1.json');
$client->addScope(Google_Service_Sheets::SPREADSHEETS_READONLY);

$service = new Google_Service_Sheets($client);
$spreadsheetId = '1zXy4MPMN0OouU_YlGg-60R535fZk0i_WItTIRRQxubA';
$range = 'Sheet1!A2:Z'; // Assuming data starts from cell A2 and ends at column Z

$response = $service->spreadsheets_values->get($spreadsheetId, $range);
$data = $response->getValues();

return view('hr.employees.approve-joinees', ['data' => $data]);
}

public function processApprovalForm(Request $request)
{
$name = $request->input('full_name');
$email = $request->input('email');
$user = new User();
$user->name = $name;
$user->email = $email;
$user->save();

$this->sendRetainershipAgreement($name, $email);

return redirect()->back()->with('success', 'Users added successfully');
}

public function sendMailToInfraTeam(Request $request)
{
$data = [
'date' => $request->input('data')['date'],
'name' => $request->input('data')['name'],
];

Mail::queue(new NewJoinerEmailForInfraTeam($data));

return redirect()->back()->with('success', 'Mail sent successfully');
}
public function sendMailBasicDetail(Request $request)
{
$joinneeMail = $request->email;
$joinneeName = $request->name;
Mail::queue(new BasicDetailsOfJoinee($joinneeMail, $joinneeName));

return redirect()->back()->with('success', 'Mail send successfully');
}

public function sendRetainershipAgreement($name, $email)
{
$pdf = Pdf::loadView('hr.application.new-joinee-offer-letter', $name);
$dashedApplicantName = str_replace(' ', '-', $name);
$timestamp = now()->format('Ymd');
$fileName = "$dashedApplicantName-$timestamp.pdf";
$directory = 'app/public/' . config('constants.hr.offer-letters-dir');
if (! is_dir(storage_path($directory)) && ! file_exists(storage_path($directory))) {
mkdir(storage_path($directory), 0, true);
}
$fullPath = storage_path($directory . '/' . $fileName);
$pdf->save($fullPath);

Mail::send(new RetainershipAgreement($name, $email, $fileName));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>Hello</div>
24 changes: 24 additions & 0 deletions Modules/HR/Resources/views/mail/basic-detail-of-joinee.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div>
<style>
.margin-bottom {
margin-bottom: 25px;
}
</style>
<p class="margin-bottom">Dear, {{ $joinneeName }}</p>
<p class="margin-bottom">Greetings from ColoredCow!
</p>
<p>Kindly fill out the form at the link below for us to start the process of onboarding you as a contractor.</p>
<a
href="https://docs.google.com/forms/d/e/1FAIpQLSeIPE873vW9AETvETyRuD7uQzwnPgH0EirbfdHpJa8H0onJWQ/viewform">https://docs.google.com/forms/d/e/1FAIpQLSeIPE873vW9AETvETyRuD7uQzwnPgH0EirbfdHpJa8H0onJWQ/viewform</a>
<p class="margin-bottom">We look forward to your valuable contributions and wish you all the very best for a
rewarding career with the organization.
</p>
<p class="margin-bottom">All the best!!</p>
<p>Regards,</p>
<p class="margin-bottom">Mohit Sharma</p>
<p>HR, Admin.</p>
<p>ColoredCow Consulting Pvt. Ltd.</p>
<p>+91 9818704141</p>
<a href="https://coloredcow.com">https://coloredcow.com</a>

</div>
17 changes: 17 additions & 0 deletions Modules/HR/Resources/views/mail/infra-team.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div>
<style>
.margin-bottom {
margin-bottom: 25px;
}
</style>
<p>Dear Infrasupport Team,</p>
<p>I hope this email finds you well. I am writing to request the creation of an email account for a new employee
{{ $data['name'] }} in our organization.
</p>
<p class="margin-bottom">If there are any specific forms or documentation required for this process, kindly let me know, and I will
promptly provide the necessary information.</p>
<p class="margin-bottom">Thank you for your prompt attention to this matter. Your assistance is greatly appreciated.
Best regards,</p>
<p class="margin-bottom">Best regards,</p>
<p>Mohit Sharma</p>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>Heelo</div>
4 changes: 4 additions & 0 deletions Modules/HR/Routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
Route::get('employee-reports', 'EmployeeController@reports')->name('employees.reports');
Route::get('fte-handler/{domain_id}', 'EmployeeController@showFTEdata')->name('employees.alert');
Route::post('/update-reviewers/{employee}', 'EmployeeController@updateEmployeeReviewers')->name('update.employee.reviewers');
Route::get('/approve-joinees', 'EmployeeController@showApprovalForm')->name('approve.joinees.show');
Route::post('/approve-joinees', 'EmployeeController@processApprovalForm')->name('approve.joinees');
Route::GET('/infra-mail', 'EmployeeController@sendMailToInfraTeam')->name('infra.mail');
Route::post('/send-basic-detail-mail', 'EmployeeController@sendMailBasicDetail')->name('approve.send-basic-mail');

Route::resource('requisition', 'RequisitionController')
->only(['index', 'show', 'store'])
Expand Down
Loading
Loading