FIX_MAIL_HELPER_ISSUE : RV
This commit is contained in:
parent
daa85c5f02
commit
4258c00f9f
@ -1662,6 +1662,9 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
public function testZeptoSMTP() {
|
||||
|
||||
echo "Inside the testZeptoSMTP function";
|
||||
|
||||
$message = '<style>body{font-family:Arial,sans-serif;color:#333;line-height:1.6;margin:0;padding:0}.email-container{width:100%;max-width:600px;margin:0 auto;padding:20px;border:1px solid #e0e0e0;background-color:#f9f9f9}.header{background-color:#4a90e2;color:#fff;padding:15px;text-align:center}.header h1{margin:0;font-size:24px}.content{padding:20px;background-color:#fff}.content h2{color:#4a90e2;font-size:20px;margin-top:0}.content p{margin:10px 0}.details-table{width:100%;border-collapse:collapse;margin-top:20px}.details-table td,.details-table th{border:1px solid #ddd;padding:10px;text-align:left}.details-table th{background-color:#f2f2f2}.footer{margin-top:20px;font-size:12px;color:#777;text-align:center}.attachment-note{margin-top:20px;padding:10px;background-color:#f7f7f7;border-left:4px solid #4a90e2;font-style:italic}</style><div class=email-container><div class=header><h1>Request for Quotation (RFQ)</h1></div><div class=content><h2>Dear {{RECIPIENT_NAME}},</h2><p>We are reaching out to request a quotation for the following insurance coverage. Please review the details below and provide your quote at your earliest convenience.<h2>RFQ Details</h2><table class=details-table><tr><th>Client name<td>{{CLIENT_NAME}}<tr><th>Coverage Type<td>{{POLICY_LONG_NAME}}<tr><th>Policy Start Date<td>{{POLICY_START_DATE}}<tr><th>Policy Duration<td>{{DURATION}}</table><div class=attachment-note>Please note: Additional terms and details are included in the attachment for your reference.</div><p>Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.<p>Best regards,<p><strong>Nhance India Pvt Ltd</strong><br></div><div class=footer><p>© Nhance India Pvt Ltd. All rights reserved.</div></div>';
|
||||
$attachments = [
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_addition.xls","fileName" => "sample_addition.xls"],
|
||||
@ -1670,9 +1673,14 @@ class MasterController extends AdminController
|
||||
];
|
||||
$email_id = 'srinivas.saravanan@venbainfotech.com';
|
||||
$common = ['mail_type'=>'test_mail_cli'];
|
||||
$bcc = 'venkateshraman786@gmail.com, srinivassaravanan2002@gmail.com, venkatesh.r@venbainfotech.com';
|
||||
$cc = 'gowtham.manavalan.la@gmail.com, venkatraj.office@gmail.com';
|
||||
|
||||
// print_r($bcc);die();
|
||||
|
||||
// Send email and get response
|
||||
$result = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message,'attachments' => $attachments,'common'=>$common]);
|
||||
|
||||
$result = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message, 'bcc'=>$bcc, 'cc'=>$cc, 'attachments' => $attachments,'common'=>$common]);
|
||||
print_r($result);
|
||||
|
||||
log_message('error',json_encode($result));
|
||||
// Format the response for display/debugging
|
||||
|
||||
@ -318,33 +318,34 @@ class MailHelper
|
||||
'htmlbody' => $message
|
||||
];
|
||||
|
||||
|
||||
// Add CC recipients if provided
|
||||
if (!empty($cc)) {
|
||||
$postData['cc'] = [];
|
||||
// Handle both string and array inputs for CC
|
||||
$ccEmails = is_array($cc) ? $cc : [$cc];
|
||||
foreach ($ccEmails as $ccEmail) {
|
||||
$postData['cc'][] = [
|
||||
$ccList = explode(',', $cc);
|
||||
$ccList = array_map('trim', $ccList);
|
||||
$postData['cc'] = array_map(function ($email) {
|
||||
return [
|
||||
'email_address' => [
|
||||
'address' => $ccEmail
|
||||
'address' => $email
|
||||
]
|
||||
];
|
||||
}
|
||||
}, $ccList);
|
||||
}
|
||||
|
||||
// Add BCC recipients if provided
|
||||
|
||||
// Add BCC if present
|
||||
if (!empty($bcc)) {
|
||||
$postData['bcc'] = [];
|
||||
// Handle both string and array inputs for BCC
|
||||
$bccEmails = is_array($bcc) ? $bcc : [$bcc];
|
||||
foreach ($bccEmails as $bccEmail) {
|
||||
$postData['bcc'][] = [
|
||||
$bccList = explode(',', $bcc);
|
||||
$bccList = array_map('trim', $bccList);
|
||||
$postData['bcc'] = array_map(function ($email) {
|
||||
return [
|
||||
'email_address' => [
|
||||
'address' => $bccEmail
|
||||
'address' => $email
|
||||
]
|
||||
];
|
||||
}
|
||||
}, $bccList);
|
||||
}
|
||||
//
|
||||
|
||||
// Handle attachments
|
||||
if (!empty($attachments)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user