I have several contacts and accounts that, for various reasons, have many email addresses each.
For example: Contact 1 has 4 valid email addresses; Contact 5 has 3 valid email addresses; β¦; Contact 2897 has 4 valid email addresses; etc β¦
When I send a campaign, if Contacts 1, 5 and 2897 are in the target list, only the primary email address will receive an email while the other addresses are ignored.
This is a big issue for me because some contacts want to be reached to all their addresses (or even better a selection of their email addresses).
The same thing applies also to Accounts.
To achieve this I know that I have to modify some code. I have identified the script: modules/Campaigns/EmailMan.php
I tried commenting out the following lines of code without success:
//check to see if bean has a primary email address
if (!$this->is_primary_email_address($module)) {
//no primary email address designated, do not send out email, create campaign log
//of type send error to denote that this user was not emailed
$this->set_as_sent($module->email1, true,null,null,'send error');
//create fatal logging for easy review of cause.
$GLOBALS['log']->fatal('Email Address provided is not Primary Address for email with id ' . $module->email1 . "' Emailman id=$this->id");
return true;
}
I also tried to create a different query to fetch the email addresses and tried to send the email to each but I have not suceeded in doing it yet.
Any suggestions?