CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Where i can find query, which collects emails for CiviMail mailing?
Pages: [1]

Author Topic: Where i can find query, which collects emails for CiviMail mailing?  (Read 3907 times)

dmitrievich

  • Guest
Where i can find query, which collects emails for CiviMail mailing?
September 08, 2007, 01:11:15 pm
I just want to change it to send mailing to all contact's emails, not only to the primary one.
I tried to set is_primary = 1 to every record in civicrm_email table, but it doesn't help.

Thanks in advance, Ilja.

« Last Edit: September 08, 2007, 01:18:35 pm by dmitrievich »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Where i can find query, which collects emails for CiviMail mailing?
September 08, 2007, 01:42:16 pm

CRM/Mailing/BAO/Mailing.php, function getRecipients (line 94 or so)

its a complex multi table query, so good luck deciphering it :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

dmitrievich

  • Guest
Re: Where i can find query, which collects emails for CiviMail mailing?
September 09, 2007, 07:41:36 am
It's hard :P :)

If anyone have wish, ability, time or something like that to help, i'll be very happy ...

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Where i can find query, which collects emails for CiviMail mailing?
September 10, 2007, 03:20:17 am
Look at CRM_Mailing_BAO_Mailing::getRecipients() – the email not only needs to be primary, it also has to belong to a primary location. Adjust the queries there accordingly (i.e., drop the lines with is_primary = 1).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

dmitrievich

  • Guest
Re: Where i can find query, which collects emails for CiviMail mailing?
September 10, 2007, 08:45:10 am
Nope :(

I removed all lines " *.is_primary = 1 " (email and location tables), but ...
Also, i tried to set is_primary = 1 in the tables (like all email are primary), but no result too...

I'm very in to solving this issue, so i very appreciate any help.

Ilja.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Where i can find query, which collects emails for CiviMail mailing?
September 12, 2007, 11:50:54 am
Sorry for the delay. I investigated it, and there’s a primary key on contact_id on the temporary tables (see the CREATE TABLE queries). You can try dropping that key, as it makes all new entries in the temporary tables for a given contact replace the old ones.

You’d have to do some testing, though, as I have no idea what will happen if you drop the primary key from that table.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

dmitrievich

  • Guest
Re: Where i can find query, which collects emails for CiviMail mailing?
September 12, 2007, 02:44:27 pm
Yep! Thats it :)

i just added one more column to the X_ and I_ tables: id int auto_increment primary key

Thank you :)

Ilja

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Where i can find query, which collects emails for CiviMail mailing?

This forum was archived on 2017-11-26.