Hi All ,
i am using before save
for triggering mail and if mail id is provided incorrect then it should set that mail id as opt_out in leads module
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class customer
{
function mail_chk(&$focus, $event, $arguments)
{
require_once('include/SugarPHPMailer.php');
$emailObj = new Email();
// echo '<pre>';
// print_r($emailObj);
echo '<pre>';
echo $focus->opt_out = 1 ;
// $focus->webtolead_email_opt_out = 1;
print_r($focus);
die;
$defaults = $emailObj->getSystemDefaultEmail();
$mail_c = new SugarPHPMailer();
$mail_c->setMailerForSystem();
$mail_c->From = $defaults['email'];
$mail_c->FromName = $defaults['name'];
$mail_c->Subject = "Greetings From Salusfin";
$mail_c->Body = "Thank you very much for contacting us and interest in our products, our marketing team will get back to you as soon as possible";
$mail_c->prepForOutbound();
$mail_c->AddAddress($focus->email1);
$mail_c->IsHTML(true);
@$mail_c->Send();
}
}
but i don’t know how to set email id opt_out using bean or any other way ???
can any one guide me on this
Thank you for your time and support
:blink: