CHANGE_MAIL_REPLY_TO_SETUP : RV
This commit is contained in:
parent
3ebc859692
commit
d26a8f7948
@ -93,6 +93,8 @@ class MailHelper
|
||||
$emaill = $params['mail'];
|
||||
$subject = $params['subject'];
|
||||
$message = $params['message'];
|
||||
|
||||
//check BCC mail
|
||||
if (isset($params['bcc'])) {
|
||||
$bcc = $params['bcc'];
|
||||
$bcc = explode(',', $bcc);
|
||||
@ -100,16 +102,23 @@ class MailHelper
|
||||
$bcc = [];
|
||||
}
|
||||
|
||||
//check CC mail
|
||||
if (isset($params['cc'])) {
|
||||
$cc = $params['cc'];
|
||||
$cc = explode(',', $cc);
|
||||
}else{
|
||||
$cc = [];
|
||||
}
|
||||
|
||||
//check REPLY TO mail
|
||||
$reply_to = "";
|
||||
if(isset($params['reply_to']) && !empty($params['reply_to'])){
|
||||
$reply_to = $params['reply_to'];
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
|
||||
$res = $gmailapi->sendMessage($emaill, $subject, $message, 'info@nhanceindia.in', 'info@nhanceindia.in', $cc, $bcc);
|
||||
$res = $gmailapi->sendMessage($emaill, $subject, $message, 'info@nhanceindia.in', $reply_to, $cc, $bcc);
|
||||
|
||||
if($res['status'])
|
||||
{
|
||||
|
||||
@ -14,6 +14,7 @@ class sendMailNotification
|
||||
{
|
||||
$wholeData =[];
|
||||
if ($action == 'member_welcome_mail') {
|
||||
|
||||
$dataToInsert = $params['dataToInsert'];
|
||||
$notification = $params['notification'];
|
||||
$client_data = $params['client_data'];
|
||||
@ -33,10 +34,13 @@ class sendMailNotification
|
||||
|
||||
$mail_content = str_replace("[[app_link]]", "<a href='$app_link'>Review Details</a>", $mail_content);
|
||||
if ($dataToInsert['relationship'] == 'Self' && $mail != null || $mail != '') {
|
||||
$wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails']];
|
||||
$wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']];
|
||||
}
|
||||
|
||||
return $wholeData;
|
||||
|
||||
} else if($action == 'member_reminder_mail'){
|
||||
|
||||
$EmployeeModel = new EmployeeModel();
|
||||
$emp_data = $params['emp_data'];
|
||||
$notification_data = $params['notification_data'];
|
||||
@ -72,9 +76,11 @@ class sendMailNotification
|
||||
}
|
||||
|
||||
if (isset($mail) && !empty($mail)) {
|
||||
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
|
||||
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']];
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
foreach ($emp_data as $key => $value) {
|
||||
if ($value['relationship'] != 'Self') {
|
||||
$emp_data = $EmployeeModel->where('client_id', $client_data['id'])->where('emp_code', $value['emp_code'])->where('is_active',1)->findAll();
|
||||
@ -96,7 +102,7 @@ class sendMailNotification
|
||||
$mail = $value['email_corporate'];
|
||||
}
|
||||
if (isset($mail) && !empty($mail)) {
|
||||
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
|
||||
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -104,10 +110,13 @@ class sendMailNotification
|
||||
if (count($wholeData) < 1) {
|
||||
$wholeData = [];
|
||||
}
|
||||
|
||||
return $wholeData;
|
||||
|
||||
// }else{
|
||||
// return "false";
|
||||
// }
|
||||
|
||||
} else if($action == 'member_ecard_mail'){
|
||||
|
||||
$notification = $params['notification'];
|
||||
@ -144,9 +153,10 @@ class sendMailNotification
|
||||
// $mail_content = str_replace("[[tpa_id]]", $tpa_id, $mail_content);
|
||||
$mail_content = str_replace("[[ecard_download_link]]", "<a href='$link/1'>Download Insurance Card</a>", $mail_content);
|
||||
$mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content);
|
||||
$wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails']];
|
||||
$wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']];
|
||||
|
||||
return $wholeData;
|
||||
|
||||
} else if($action == 'member_review_and_summary_mail'){
|
||||
|
||||
$array_list = $params['array_list'];//employeee lst
|
||||
@ -314,7 +324,7 @@ class sendMailNotification
|
||||
|
||||
// $mail = "aadhavanvalli@gmail.com";
|
||||
// if (isset($mail) && !empty($mail)) {
|
||||
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
|
||||
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']];
|
||||
// }
|
||||
|
||||
return $wholeData;
|
||||
@ -491,7 +501,7 @@ class sendMailNotification
|
||||
$full_name = $value['first_name'] .' ' .$value['last_name'];
|
||||
$mail_content = str_replace("[[member_name]]", $full_name , $mail_content);
|
||||
|
||||
$wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content];
|
||||
$wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']];
|
||||
// $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
|
||||
}
|
||||
return $wholeData;
|
||||
@ -667,7 +677,7 @@ class sendMailNotification
|
||||
$mail_array = array_map('trim', $mail_array);
|
||||
$wholeData = [];
|
||||
foreach ($mail_array as $key => $value) {
|
||||
$wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content];
|
||||
$wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']];
|
||||
// $wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ class ClientModel extends Model
|
||||
"reference",
|
||||
"phone",
|
||||
"email",
|
||||
"reply_to",
|
||||
];
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user