Hot to send campaigns to all email addresses of a contact/account

Does anyone know how would it be possible to send a campaign not only to the primary message but also to all other valid (and not opted out) email addresses of a contact/account?

I tried to check the campaigns code but I found it hard to understand. Specially I haven’t been able to find the portion of code where the target lists are used to fetch the email addresses to which the campaigns are then sent.

Any help would be very appreciated!

Hi

maybe a work around would be to search for contacts which are associated to an account. Select all the contacts that the search spits out and add those contacts to the target list? This wont add the account itself though

Hope this helps

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.

Hi amariussi,

I have the same issue.
In case you have already solved this issue, can you please share how you did it? Thank you! :slight_smile:

Hi Indigo21,

I had put this aside but I am obliged to work on it in the next 15 days to meet a client requirement.

The solution I have developed so far is non upgrade safe since it modifies some core files of the Campaigns module.

Beware that, from the latest roadmap Sales Agility have put a refactoring of the Campaign module (I hope it will include this possibility) so, if I manage to get it to work and you deploy it you may have to review the modifications in that future release.

Hello @amariussi
News about this?
I’m looking for same solution

thank you so much

Riccardo

@riccardogt Please open a new thread as this one is very old :+1: