Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-16733

Find Participants - Send Email to Contacts: If a contact has multiple selected registrations (different events), send email for each registration

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.6.4
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None

      Description

      Send Email to Contacts task from Find Participants - if multiple registrations selected for the same contact, we get a notice (see below), AND only one email is sent. We should send an email for each registration (as Tim notes in his comment below).

      — Original Post —
      When you use the mailing action (mail to participants) on the participant overview a notice appears in a specific situation.

      Notice: Undefined offset: 147 in CRM_Contact_Form_Task_EmailCommon::buildQuickForm() (line 229 of /sites/all/modules/civicrm/CRM/Contact/Form/Task/EmailCommon.php).

      To reproduce:
      -Register contact A for two different events.
      -Remove mailadres from contact or mark deceased
      -Search participant for different event so contact A shows up in result twice (once for both events).
      -Mail to participants (including double participant).

      Now the notice shows.
      The problem lies inside CRM_Contact_Form_Task_EmailCommon::buildQuickForm(&$form) method. This common class is used in CRM_Event_Form_Task_Email
      This method removes the 'deceased / no mailing' contact-ids from the selection before making the form. It howerver removes the first contact-id, before checking the rest. In a participant selection a contact id could however appears twice. Which makes the unsetting done too early. We unset the contact id, and try to iterate through it afterwards.

      A solution according to me is split up the buildform method, to get the validation in a seperate method, that way we could override the validation for the participant task.

      i'll create a PR.

        Attachments

          Activity

            People

            • Assignee:
              mallezie Tim Mallezie
              Reporter:
              mallezie Tim Mallezie
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: