Initial recipe for a basic contact form for Drupal CMS. Full proposal here

Leveraging WebForm contrib, recipe will:

  • Install Webform and dependencies
  • Create a “Basic” contact form, consisting of:
    • Name* (single field)
    • Email*
    • Message*
    • Submit action
      • Sends message to the admin email on file
      • Stores the contact in DB with relevant info (date/time, form name)
    • * “required” is assumed for these minimum fields
  • With optional fields, configured on Recipe initialization via a checkbox, for:
    • Business name
    • Phone
    • Zip code?
    • Others TBD, but to be kept very simple (no conditional logic, no external subscription service like MailChimp)
  • Create a “Contact” page with the Webform block (?) added
  • Creates a Menu item for the Contact page, if a Menu exists

Issue fork starshot-3454545

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Issue fork drupal_cms-3454545

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pameeela created an issue. See original summary.

pameeela’s picture

Issue summary: View changes
pameeela’s picture

Issue summary: View changes
thejimbirch’s picture

Issue tags: +Recipes initiative
pameeela’s picture

This track is in need of a lead. See Dries' blog post for more info, read about the track lead position, or just apply now!

rachelh_design’s picture

We're attempting to organize a team to work on this at Oomph. For me, I can help with gathering requirements and any design needs. Once we find the right person to lead, we'll send in the application!

pameeela’s picture

Great news, thanks @rachelh_design!

pameeela’s picture

Project: Starshot » Drupal CMS development repository
Component: Miscellaneous » Track: Contact form
pameeela’s picture

Issue summary: View changes
pfrilling’s picture

Issue summary: View changes

phenaproxima’s picture

Status: Active » Needs work

There are a few things here which need to be changed.

pfrilling’s picture

Status: Needs work » Needs review

I fixed the obvious things and left comments for a few others. Changing this to needs review for visibility, but I'm sure more work will follow.

phenaproxima’s picture

Status: Needs review » Needs work

Thank you for the very clear and sensible explanations! I think I can see a few ways forward; commented in the MR. Curious what you think.

pfrilling’s picture

Status: Needs work » Needs review

I think this is ready to review again.

phenaproxima’s picture

Title: [META] Track 5: Create "Contact form" recipe » Create "Contact form" recipe

This issue has an MR needing review, so I guess it's...not a meta. Removing that designation.

phenaproxima’s picture

That looks pretty good to me overall, just a few points of clarification/feedback/follow-ups.

phenaproxima’s picture

Status: Needs review » Needs work

Everything looks great here - I just have a suggestion for `drupal_cms_anti_spam` so that we can be certain the `authenticated` user role exists, without merely hoping that it was installed by the User module (even though it's a required role -- we're just being paranoid here).

Once that suggestion is implemented (or kicked back if it doesn't work), I'm okay committing this.

pameeela’s picture

Title: Create "Contact form" recipe » Create initial contact form recipe
Issue summary: View changes
Parent issue: #3454529: [META] Drupal CMS 1.0 work tracks » #3479360: [META] Track: Create "Contact form" recipe
Related issues: -#3454528: [META] Track 4: Recommend official recipes in the installation process

We still want a meta, so I created a new one and updated references.

jurgenhaas’s picture

With regard to the anti spam integration of the contact form, please note there is a proposal at #3477309: Add the Friendly CAPTCHA module, and optional CAPTCHA support to the contact form to use friendlycaptcha for that. The contact form recipe requires the antispam recipe, so if the antispam changes strategy, this will change for the contact form as well.

Just wanted to leave this heads-up here just so that this recipe doesn't necessarily have to put extra effort into anti-spam, unless you have additional requirements?

pfrilling’s picture

Status: Needs work » Needs review

I addressed all the feedback in the MR.
- I decided to list out all of the webform configuration instead of archiving the one form that shipped with Webform.
- I reverted any changes I made to the anti spam recipe. I'll create a followup issue to address changes in #3477309
- I did add a cypress e2e test, which passes locally, but not in CI. I don't think the E2E testing is configured quite right in the CI. It seems that the site is not getting installed in that CI environment.

phenaproxima’s picture

Status: Needs review » Needs work

This is shaping up; I love the test coverage! However, there are some flaws here that arise from a few minor misunderstandings of how to write recipes. I'm also very ambivalent about explicitly importing all of Webform's config entities, even the ones we don't need.

pfrilling’s picture

Status: Needs work » Needs review

I believe I addressed everything. This is ready for another review.

phenaproxima’s picture

Title: Create initial contact form recipe » [PP-1] Create initial contact form recipe
Status: Needs review » Postponed

Tests are failing, and we'll need to fix that before merging -- but I'm also busily building a basic framework for Cypress testing over in #3479610: Add Cypress test to the base SEO recipe, so let's postpone this on that.

phenaproxima’s picture

Title: [PP-1] Create initial contact form recipe » Create initial contact form recipe
Status: Postponed » Needs work

Alright - #3479610: Add Cypress test to the base SEO recipe is in, so I think we can start hauling this to the finish line! Let's get the tests passing, and model the E2E tests on drupal_cms_seo_basic/tests/e2e/spec.cy.js.

phenaproxima’s picture

Status: Needs work » Reviewed & tested by the community

I think this is good to go. The recipe looks good, is lean, and has strong test coverage (thanks @pfrilling)! We don't need to hold this up any longer. With regard to @jurgenhaas's point in #20, the tests will certainly help us adjust properly if and when we switch to Friendly CAPTCHA.

I'm shipping it!

phenaproxima’s picture

Assigned: Unassigned » phenaproxima

Hmmm...something odd is going on with one test, not sure why - self-assigning to figure it out.

phenaproxima’s picture

Assigned: phenaproxima » Unassigned

Boy, getting this to work properly took some doing, but it also revealed a major flaw in the way I built some of the Cypress infrastructure in #3479610: Add Cypress test to the base SEO recipe. What can I say...this whole thing is a learning experience. Anyway - that flaw, at least, is fixed and means that specs are properly isolated from each other.

phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Finally! The ship sails. Great work here!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.