Commit eefd2d43 by Azhan Hannan

email function

parent ad6d9497
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class AddProjectTeam extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $data_staffs;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $data_staffs)
{
$this->data_email = $data_email;
$this->data_staffs = $data_staffs;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('emails.AddProjectTeam');
}
}
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class EditMandays extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $data_mandays;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $data_mandays)
{
$this->data_email = $data_email;
$this->data_mandays = $data_mandays;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this
->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('mail.content.EditMandays');
}
}
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class EditProject extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email)
{
$this->data_email = $data_email;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this
->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('emails.EditProject');
}
}
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class EditProjectTeam extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $old_data;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $old_data)
{
$this->data_email = $data_email;
$this->old_data = $old_data;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this
->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('mail.content.EditProjectTeam');
}
}
...@@ -27,6 +27,7 @@ class Pteam extends Model ...@@ -27,6 +27,7 @@ class Pteam extends Model
{ {
return $this->hasOne('Portal\Timesheet\Model\Project','id','fk_project_id') return $this->hasOne('Portal\Timesheet\Model\Project','id','fk_project_id')
->where('p_project_sts', 1) ->where('p_project_sts', 1)
->with('projectDirector')
->withTrashed(); ->withTrashed();
} }
......
@component('mail::message')
# Meet our newly appointed project team!
Assalamualaikum w.b.t Mr/Mrs.
{!! $data_email['projectdirector'] !!}
We would like to inform you on as we have appointed @if(count($data_staffs) > 1)new team members @else a new team member @endif to join our {!! $data_email['projectname'] !!} project.
Project details : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Project Code</th>
<th style="border: black 1px solid;">Project Name</th>
<th style="border: black 1px solid;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;">{!! $data_email['pcode'] !!} </td>
<td style="border: black 1px solid;">{!! $data_email['projectname'] !!}</td>
<td style="border: black 1px solid;">{!! $data_email['projectmanager'] !!}</td>
<td style="border: black 1px solid;">{!! $data_email['projectdirector'] !!}</td>
<td style="border: black 1px solid;">@if( $data_email['status'] == 1) Active @else Inactive @endif</td>
</tr>
</tbody>
</table>
<br>
New project @if(count($data_staffs) > 1)members @else member @endif : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">No</th>
<th style="border: black 1px solid;">Name</th>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
@foreach($data_staffs as $key => $staff)
<tr>
<td style="border: black 1px solid; width: 10%;">{!! $key+1 !!} </td>
<td style="border: black 1px solid; width: 40%;">{!! $staff['name'] !!} </td>
<td style="border: black 1px solid; width: 40%;">{!! $staff['role'] !!}</td>
<td style="border: black 1px solid; width: 10%;">@if( $staff['status'] == 1) Active @else Inactive @endif</td>
</tr>
@endforeach
</tbody>
</table>
<br>
We wish for a better performance for this project as we appointed new team members.
Thank you. <br>
<!-- <br> -->
---
<br>
<i>This is an auto generated message, please do not reply.</i>
<!-- Thanks,<br> -->
<!-- {{ config('app.name') }} -->
@endcomponent
\ No newline at end of file
@component('mail::message')
# Project details has been edited!
Assalamualaikum w.b.t Mr/Mrs.
{!! $data_email['projectdirector'] !!}
We would like to inform you as there are changes in our project details.
The new project details as below : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Project Code</th>
<th style="border: black 1px solid;">Project Name</th>
<th style="border: black 1px solid;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $data_email['pcode'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectname'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectmanager'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectdirector'] !!} </td>
<td style="border: black 1px solid;"> @if( $data_email['status'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
We wish for a better performance for this project as the changes and alteration has been made for the betterment of the company.
Thank you. <br>
<!-- <br> -->
---
<br>
<i>This is an auto generated message, please do not reply.</i>
<!-- Thanks,<br> -->
<!-- {{ config('app.name') }} -->
@endcomponent
\ No newline at end of file
@component('mail::message')
# Introduction
The body of your message.
Thanks,<br>
{{ config('app.name') }}
@endcomponent
@component('mail::message')
# Project mandays details has been updated!
Assalamualaikum w.b.t Mr/Mrs.
{!! $data_email['projectdirector'] !!}
We would like to inform you as there are updates in our project mandays details.
The project details as below : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Project Code</th>
<th style="border: black 1px solid;">Project Name</th>
<th style="border: black 1px solid;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $data_email['pcode'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectname'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectmanager'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectdirector'] !!} </td>
<td style="border: black 1px solid;"> @if( $data_email['status'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
The project mandays update are as below:
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Days</th>
<th style="border: black 1px solid;">Hours</th>
</tr>
</thead>
<tbody>
<?php $totaldays = $totalhours = 0; ?>
@foreach($data_mandays as $key => $data)
<tr>
<td style="border: black 1px solid;"> {!! $data['role'] !!} </td>
<td style="border: black 1px solid;"> {!! $data['days'] !!} </td>
<td style="border: black 1px solid;"> {!! $data['hours'] !!} </td>
</tr>
<?php $totaldays += $data['days']; ?>
<?php $totalhours += $data['hours']; ?>
@endforeach
<tr>
<td style="border: black 1px solid;">Total</td>
<td style="border: black 1px solid;">{{ number_format($totaldays, '1', '.', '') }}</td>
<td style="border: black 1px solid;">{{ number_format($totalhours, '1', '.', '') }}</td>
</tr>
</tbody>
</table>
<br>
We wish for a better performance for this project as the changes and alteration has been made for the betterment of the company.
Thank you. <br>
<!-- <br> -->
---
<br>
<i>This is an auto generated message, please do not reply.</i>
<!-- Thanks,<br> -->
<!-- {{ config('app.name') }} -->
@endcomponent
\ No newline at end of file
@component('mail::message')
# Project team details has been edited!
Assalamualaikum w.b.t Mr/Mrs.
{!! $data_email['projectdirector'] !!}
We would like to inform you as there are changes in our project team details.
The project details as below : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Project Code</th>
<th style="border: black 1px solid;">Project Name</th>
<th style="border: black 1px solid;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $data_email['pcode'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectname'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectmanager'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectdirector'] !!} </td>
<td style="border: black 1px solid;"> @if( $data_email['status'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
The project team details has been change from : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Name</th>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $old_data['oldname'] !!} </td>
<td style="border: black 1px solid;"> {!! $old_data['oldrole'] !!} </td>
<td style="border: black 1px solid;"> @if( $old_data['oldstatus'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
To:
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Name</th>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $data_email['teamname'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['role'] !!} </td>
<td style="border: black 1px solid;"> @if( $data_email['teamstatus'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
We wish for a better performance for this project as the changes and alteration has been made for the betterment of the company.
Thank you. <br>
<!-- <br> -->
---
<br>
<i>This is an auto generated message, please do not reply.</i>
<!-- Thanks,<br> -->
<!-- {{ config('app.name') }} -->
@endcomponent
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment