Hi Darren,
Thanks for the try but, unfortunately this was not my question.
Probably I did not explain clearly enough.
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?
Concerning your suggested workaround, that answers partially another problem that I have. For example: if I want to send an email, let’s say, to all the companies whose main postal address is located in London and all their emeployees (wherever they are located).
Your workaround is feasible only if I have a few Accounts so I can do it manually.
If, on the other hand, I have several hundreds of accounts, this solutions is not viable anymore.