Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • R resendmailing
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Extensions
  • resendmailing
  • Merge requests
  • !10

Avoid fatal errors when resending to an existing recipient

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open bgm requested to merge bgm/resendmailing:issue3 into main Dec 13, 2022
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 3

Replaces !5 (closed)

(original description)

I ran into #3 and could reproduce it fairly systematically:

  • Send a mailing to some recipients normally (not using this extension)
  • Then use this extension to resend the mailing to a single contact
  • and then resend to them again (using the same form)

For the problem to happen, activity creation must be enabled (which is the CiviCRM default, iirc).

The interface would show "DB error: already exists", this is because of writeToDB which checks if an activity already exists for the mailing, and if so, it adds the contact as a target to that activity. If they already received the mailing, then it causes a duplicate, which the DB prevents because of unique indexes.

And then, for some mysterious reason which could only be found in the forgotten depths of old BAOs, CiviCRM resends the mailing to all the original recipients of the mailing.

This MR also does a small change to the interface: it only lists non-SMS mailings (it does not work with SMS mailings, and nice to have them out of the way).

Edited Dec 13, 2022 by bgm
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: issue3