Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a CF7 submission is un-spammed, it should be treated the same as an allowed form submission #166

Open
crweiner opened this issue Feb 5, 2025 · 3 comments

Comments

@crweiner
Copy link

crweiner commented Feb 5, 2025

Description

When a Contact Form 7 (CF7) submission is marked as spam on https://opensource.org/ai/endorsements, it skips adding the submitter as a pending Supporter (a custom CPT).

However, if a CF7 submission is incorrectly categorized as spam, then manually marked as not spam in Flamingo, then the code in PR #162 is not being triggered.

We will look to see if there is a way to trigger the same code/hooks if a form submission is marked as not spam in Flamingo in the same way that it would have been triggered if the CF7 submission went through properly.

Image

See the following #149 and #162 for a background on the Supporter CPT and how it connects to CF7:

See the internal dev request for further information.

@crweiner crweiner changed the title When a CF7 submission is un-spammed, it should be treated the same as an approved submission When a CF7 submission is un-spammed, it should be treated the same as an allowed form submission Feb 5, 2025
@nickpagz
Copy link
Collaborator

@crweiner I've merged a fix to develop that should do the trick. To test it, add a new entry to the form, then edit the form in wp-admin at Flamingo > Inbound Messages by toggling it to spam then unspam (because there's no current spam entries on the staging site and your entry probably won't be spam either), it should create a new pending entry in "Supporters". The new pending "Supporter" should also only get created for "channels" from the "'OSAID Endorsement" form.

Let me know.

@crweiner
Copy link
Author

Thanks so much, @nickpagz! I used the Akismet akismet‑guaranteed‑spam test line in the message body and Akismet marked it as Spam, as expected. When I then toggled the entry in Flamingo to Not Spam, I do see that it creates a pending entry to the Supporters CPT! 🎉

A few things I noted, and I'm not sure if any of these need to be changed or not:

  • If the spam submission is toggled to Not Spam, then Spam, and back to Not Spam, it will create a duplicate pending entry in the Supporters CPT.
    • It also creates multiple Supporters entries if multiple spam submissions from the same individual are marked as Not Spam. If a message is marked as spam, then the CF 7 form says: "There was an error trying to send your message. Please try again later." This can lead to multiple submission attempts back-to-back, which is what we saw on prod, and possible extra Supporters entries if they are all marked as Not Spam.
  • The multiple Supporters CPT entries all have the same permalink, but different post IDs. Will this create an issue?

cc: @ajolo2ky for their input (I'll also reach out via email)

@ajolo2ky
Copy link
Contributor

Hi team,

Thanks for the work on this issue!

Having multiple entries under the same permalink shouldn't be a problem for us (although that shouldn't happen as a person should endorse it one time only), so if we have multiple records for the same person, that's ok from a functionality standpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants