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) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Sending duplicate emails
Pages: [1] 2

Author Topic: Sending duplicate emails  (Read 8726 times)

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Sending duplicate emails
January 03, 2009, 11:01:18 am
Is there a way to avoid sending duplicate emails to the same address?  We have lots of people who share an email address within a household, or at least they tell us they do.  Like several children give us mom's email address, maybe (I'm just guessing here) because mom doesn't want to give out the kids' direct email addresses.  Then mom complains because she gets multiple emails from us.

Anyway it would be great if CiviMail would filter out duplicates.  We could manually maintain a group for this purpose but that would be a huge effort.

Is there a way to do this?

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: Sending duplicate emails
January 03, 2009, 01:32:36 pm

Not in 2.2 or prior. This has come up a couple of times recently, so a code contribution would be great. You'll just have to modify the query in:

CRM/Mailing/BAO/Mailing.php, function getRecipients

If you are not a developer, consider hiring someone and/or sponsoring development of the feature

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

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Sending duplicate emails
January 06, 2009, 05:20:49 pm
Ok here is a patch that eliminates duplicates from the temporary mailing table.  I am not really familiar with civicrm internals but it seems to work so far.



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: Sending duplicate emails
January 07, 2009, 06:59:46 am

cool. thanx for taking the time and initiative to do this. I suspect other folks will find it useful also.

We'll incorporate some version of this patch in a future release: http://issues.civicrm.org/jira/browse/CRM-3975

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

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: Sending duplicate emails
March 12, 2009, 07:57:58 am
Can this be applied to an earlier version of civicrm say 2.0.6?

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: Sending duplicate emails
March 12, 2009, 08:11:44 am

i suspect it can, but it might need to be manually applied. if i remember right most of the patch was using "REPLACE" instead of "INSERT"

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

Alan.Guggenheim

  • Guest
Re: Sending duplicate emails
April 06, 2010, 07:41:40 am
When people buy tickets for events and do not have the email address of their guests, they enter their email address, and a contact is created for each guest.
Then all blast mailings send multiple emails to the same email address (In my case, one generous lady bought 8 tickets and is getting 8 emails!)
Is there a fix available already for 3.1.3? If not, any solution? Is this patch applicable to 3.1.3?
Thanks

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: Sending duplicate emails
April 06, 2010, 08:00:08 am

you should be able to apply that patch to 3.1.3. that functionality is not part of core as yet

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

Alan.Guggenheim

  • Guest
Re: Sending duplicate emails
April 06, 2010, 08:09:34 am
Thanks. I will try and report.

Alan.Guggenheim

  • Guest
Re: Sending duplicate emails
April 10, 2010, 07:25:28 pm
I tried to apply the patch, but it does not find the file to pacth.

geert.je

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
    • Flemish environment movement
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7
Re: Sending duplicate emails
May 19, 2010, 02:18:09 am
I'm also interested. Where can i find this patch? I'm nut sure it was posted here???
Geert

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Sending duplicate emails
May 20, 2010, 04:00:29 am
Quote from: Alan.Guggenheim on April 10, 2010, 07:25:28 pm
I tried to apply the patch, but it does not find the file to patch.

It patches the Mailing.php file, so you need to apply it when in the CRM/Mailing/BAO directory.

Note that this patches CiviMail, not CiviEvent.
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.

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Sending duplicate emails
May 20, 2010, 04:01:26 am
Quote from: geert.vosec on May 19, 2010, 02:18:09 am
I'm also interested. Where can i find this patch? I'm nut sure it was posted here???

It’s posted in the third message in this topic: http://forum.civicrm.org/?topic=6070#msg26918
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.

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Sending duplicate emails
May 08, 2011, 05:43:17 am
Hey, Piotr!

I've been using this patch successfully on several sites (thank you, robinhood!), but it looks like the patch no longer successfully applies on 3.4.x - I get the following:

patch -p0 < Mailing-1.php.patch
patching file Mailing.php
Hunk #1 succeeded at 218 with fuzz 1 (offset 13 lines).
Hunk #2 FAILED at 227.
Hunk #3 succeeded at 260 (offset 15 lines).
Hunk #4 FAILED at 306.
Hunk #5 succeeded at 348 with fuzz 2 (offset 34 lines).
Hunk #6 succeeded at 378 (offset 34 lines).
2 out of 6 hunks FAILED -- saving rejects to file Mailing.php.rej

Is there any possibility of getting an updated patch? Will the patched file work, even with errors? Hoping to be able to have this functionality with 3.4 and beyond... thanks!

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Sending duplicate emails
May 10, 2011, 06:05:24 am
Quote from: bcobin on May 08, 2011, 05:43:17 am
I've been using this patch successfully on several sites (thank you, robinhood!), but it looks like the patch no longer successfully applies on 3.4.x

Can you try this patch? I haven’t tested it, but it seems hunk #2 just needed some nudging, while hunk #4 needed rewriting. Note that previously the query from hunk #4 was a SELECT DISTINCT one, while now it’s just SELECT; I kept it like this, but you might want to check whether it shouldn’t be a DISTINCT one after you add the email column.
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.

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Sending duplicate emails

This forum was archived on 2017-11-26.