CRM-19317 Notify when profile form is submitted? not receiving email if contact is matched/updated

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7.10
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      Steps to reproduce:

      1. configure profile as Standalone Form with email field

      2. In advanced settings Choose this option:
      What to do upon duplicate match = Update the matching contact

      3. In advanced settings Choose this option:
      Notify when profile form is submitted? = your@email.com

      4. create contact in database: not-your@email.com

      5. use form in create mode, enter not-your@email.com

      6. note that form is submitted and contact is updated, yet you do not get an email at your@email.com

        Attachments

          Activity

          [CRM-19317] Notify when profile form is submitted? not receiving email if contact is matched/updated
          Shrikant Jadhav added a comment -

          I followed above steps, Initially I was not able to receive notification mail after submitting profile form as you said.

          To tackle this problem i started with mail account settings and it was fine. Then i dig in the code and crosscheck if all the needed variables(header, recipient, mail body etc) are set and have valid values. They all were fine.
          In next step i debug mail() function and i noticed that mail() function returning 1 as a acknowledgement, that simply means mail() function did his work, after mail() function execution control goes to respective handler which is mail server in this case. So I concluded that problem is not in the code but in the mail server itself.

          To cross check my conclusion, i replaced SMTP settings in

          1) Mail Account : Administer -> civiMail -> Mail Accounts
          2) From Email Addresses : Administer -> civiMail -> From Email Addresses

          with settings provided by a tool called ‘test mail server’ and settings passed that test. So i am quite sure that mail server is causing this bug.

          Stoob added a comment -

          Thank you for your comments.

          I am confused, how do you explain that the email is sent from CiviCRM when the contact IS NOT updated (no matching contact is found) but no email is sent when the contact IS updated (matching contact found)?

          If the email server is the problem, wouldn't it never send email?

          Shrikant Jadhav added a comment -

          Sorry for confusion .

          What I did is as follow,

          I have one contact in database "Dr. Rolando Cooper".
          then added email id for this contact "rolandocooper@gmail.com"

          After that i go to newly created profile page where i have only one field email id. Used Create mode button to quick add email id.
          Then added "rolandocooper@gmail.com" in email text box and clicked on submit.
          And I received a mail . Following are the plain text content of mail

          Submitted For Dr. Rolando Cooper
          Date Tue, 20 Sep 2016 00:26:39 +0530
          Contact Summary http://localhost/drupal/civicrm/contact/view?reset=1&cid=34
          test emmail
          Email (Primary) rolandocooper@gmail.com

          Sorry but I am not able to reproduce this issue.
          Please let me know if I am doing anything wrong, So that I will be able to reproduce the issue and resolve it.

          Thanks

          Stoob added a comment -

          I have found out what the issue is: contact subtype.

          1. create a contact of type "individual".

          2. When you create the profile: set the first name and last name field to be a individual subtype, such as "student".

          3. The profile will update the information and change contact type from "individual" to "individual: student".

          4. however no email is sent, perhaps because of the subtype.

          At attachment will show how my profile is configured, using a subtype.

          Stoob added a comment -

          "volunteer" is an individual contact subtype

          Stoob added a comment -

          Actually, that's not the problem, I have to do more testing. Wait, and I will let you know when I have more information.

          Andrew West added a comment -

          Tracked this one down, I think. PR here: https://github.com/civicrm/civicrm-core/pull/10240

          CRM/Core/BAO/UFGroup:filterUFGroups() checks to make sure that the contact type of the updated record is the same as that of the profile. But sometimes the contact type of the profile is returned as an array rather than a string (presumably when it matches an existing record). filterUFGroups() didn't account for that. The PR adds an extra check.

            People

            • Assignee:
              Unassigned
              Reporter:
              Stoob

              Dates

              • Created:
                Updated: