Contact form opt-out line should be excluded from admin-sent and sender-copy e-mails

Created on 5 March 2007, over 17 years ago
Updated 17 April 2024, 7 months ago

Problem/Motivation

When an admin sends an email to a user via the personal contact form, it has this message:

Brad Landis (site/user/1) has sent you a message via your
contact form (site/user/12/contact) at siteName.

If you don't want to receive such e-mails, you can change your settings at
site/user/12.

But even if you change the settings, the admin can still contact you. If the admin user sends the email, this message should not be included.

Steps to reproduce

  1. Install Drupal
  2. Enable contact module
  3. Create a non-admin user and opt out of the personal contact form
  4. Visit that user's profile as an admin and see that you can still contact them via the form
  5. Send a message to an email address you have access to and confirm it includes text about how to opt out, even though you can't opt out of emails from admins

Proposed resolution

Don't include the opt-out text line in emails from users with 'Administer users' permission.

Remaining tasks

  1. Convert existing patch to MR
  2. Review
  3. Commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ› Bug report
Status

Fixed

Version

10.2 ✨

Component
ContactΒ  β†’

Last updated 2 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States bradlis7

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Won't tag for it but this could use an issue summary update to match the standard template. Not the most clear.

    Can verify this problem on D10

    Think this needs some work though

    Created userA and userB
    userB is content editor with permissions to administer user (so they can see users) and permission to contact user
    UserA opted out of contact form
    Login as userB I would expect to not see the contact tab for userA but I do and can send an email
    userA received an email with the

    If you don't want to receive such emails, you can change your settings at
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Discussed in Slack, I think that the tab access issue mentioned in #85 is out of scope, this issue is to address the email text only. And if the email text is corrected, it's not unexpected that admins can view your contact tab, because as the OP notes, admins can still contact you even if you have opted out.

    So in the interest of seeing this resolved, I think it should only be concerned with the email content.

  • πŸ‡¦πŸ‡ΊAustralia pameeela
  • Merge request !7279Create MR from patch & update comments β†’ (Open) created by pameeela
  • Pipeline finished with Failed
    8 months ago
    Total: 214s
    #135076
  • Status changed to Needs review 8 months ago
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    MR created.

  • Pipeline finished with Success
    8 months ago
    Total: 726s
    #135090
  • Status changed to RTBC 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Hiding patches for clarity.

    Ran test-only feature

    1) Drupal\Tests\contact\Functional\ContactPersonalTest::testPersonalContactForm
    Opt-out message included in email.
    Failed asserting that false is true.
    /builds/issue/drupal-124969/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121
    /builds/issue/drupal-124969/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
    /builds/issue/drupal-124969/core/lib/Drupal/Core/Test/AssertMailTrait.php:100
    /builds/issue/drupal-124969/core/modules/contact/tests/src/Functional/ContactPersonalTest.php:376
    /builds/issue/drupal-124969/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    FAILURES!
    

    As mentioned in slack #85 is out of scope for this issue and can be ignored.

    Issue summary is clear about the problem and steps to show the issue.

    When applying the MR and following the steps I get the expected behavior.

    Believe this long standing bug is good to go.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Committed and pushed 1dbf2cc2ea to 11.x and e1a29d0851 to 10.3.x and 5fa98acae9 to 10.2.x. Thanks!

    • alexpott β†’ committed 5fa98aca on 10.2.x
      Issue #124969 by Dave Reid, andregp, naxoc, pameeela, ravi.shankar,...
    • alexpott β†’ committed e1a29d08 on 10.3.x
      Issue #124969 by Dave Reid, andregp, naxoc, pameeela, ravi.shankar,...
  • Status changed to Fixed 8 months ago
    • alexpott β†’ committed 1dbf2cc2 on 11.x
      Issue #124969 by Dave Reid, andregp, naxoc, pameeela, ravi.shankar,...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024