Description

Using this module you don't need to setup a mail server or external smtp to send contact form data.
Submit contact-forms or webforms trough formspree.io.

Features:

- Select forms using a jQuery selector
ex.".webform-client-form" or defaults to ".contact-form"
- Set a mailto value or defaults to site mail.

Dependencies:

jQuery Update

Project page

https://www.drupal.org/sandbox/rudam/2757401

Git clone command

git clone --branch 7.x-1.x https://git.drupal.org/project/formspree.git formspree
cd formspree

Usage:

Set a selector and mailto in /admin/config/system/formspree
Selected form's will be submitted to your email trough formspring.io

CommentFileSizeAuthor
#15 formspree-error.PNG42.43 KBarun ak

Comments

rudam created an issue. See original summary.

rudam’s picture

Issue summary: View changes
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxrudam2757401git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

panshulk’s picture

Automated Review

Best practice issues identified by pareview.sh

Manual Review

Individual user account
[Yes: Follows] the guidelines for individual user accounts.
No duplication
[Yes: Does not cause] module duplication and/or fragmentation.
Master Branch
[Yes: Follows ] the guidelines for master branch.
Licensing
[Yes: Follows] the licensing requirements.
3rd party assets/code
[Yes: Follows] the guidelines for 3rd party assets/code.
README.txt
[No: Does not follow] the guidelines for in-project documentation and/or the README Template.

Check the README template

Code long/complex enough for review
[Yes: Follows ] the guidelines for project length and complexity.

This review uses the Project Application Review Template.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

rudam’s picture

Readme fixed.

rudam’s picture

Status: Closed (won't fix) » Needs review
anand.toshniwal93’s picture

Automated Review

There are lots of coding standard issues are there pareview.sh

Manual Review

Individual user account
[Yes: Follows] the guidelines for individual user accounts.
Master Branch
[Yes: Follows ] the guidelines for master branch.
Licensing
[Yes: Follows] the licensing requirements.
3rd party assets/code
[Yes: Follows ] the guidelines for 3rd party assets/code.
README.txt/README.md
[Yes: Follows ] the guidelines for in-project documentation and/or the README Template.
Secure code
[Yes: Meets the security requirements.]

This review uses the Project Application Review Template.

anand.toshniwal93’s picture

Status: Needs review » Needs work
rudam’s picture

Fixed all the issues in pareview.sh.

rudam’s picture

Status: Needs work » Needs review
ginorodrigues’s picture

Automated Review
Passed.

Manual Review

Individual user account
[Yes: Follows] the guidelines for individual user accounts.

No duplication
[Yes: Does not cause] module duplication and/or fragmentation.

Master Branch
[Yes: Follows ] the guidelines for master branch.

Licensing
[Yes: Follows] the licensing requirements.

3rd party assets/code
[Yes: Follows] the guidelines for 3rd party assets/code.

README.txt/README.md
[Yes: Follows ] the guidelines for in-project documentation and/or the README Template.

Code long/complex enough for review
[Yes: Follows ] the guidelines for project length and complexity.

This review uses the Project Application Review Template.

visabhishek’s picture

@ginorodrigues : Looks like you forgot to change the status. Is this now RTBC after your review or are there application blockers left and this should be "needs work"?

ginorodrigues’s picture

Status: Needs review » Reviewed & tested by the community

@visabhishek thanks, you are right, I am updating now.

arun ak’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new42.43 KB

Once enable formspree for a form then it skipping all other form validations other than required field validation. Email validaton is getting failed in contact form.

Same validation error will happen for all forms. Please refer screenshot.

Code too short
This project is too short to approve you as git vetted user. We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project for you.
arun ak’s picture

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

rudam’s picture

Hello @ARUN AK, I did not manage to reproduce this error. Im also using this module in some published websites flawlessly.
I just installed a fresh drupal, enabled contact and formspree and only set the email in the formspree config page:

root@drupalteste:/var/www/html# mv drupal-7.51/ drupal
root@drupalteste:/var/www/html# cd drupal/
root@drupalteste:/var/www/html/drupal# drush site-install --db-url=mysql://root:_____@localhost/drupalteste
You are about to create a /var/www/html/drupal/sites/default/settings.php file and CREATE the 'drupalteste' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                          [ok]
Installation complete.  User name: admin  User password: AkHszuwexx                                                   [ok]
root@drupalteste:/var/www/html/drupal# cd sites/all/modules/
root@drupalteste:/var/www/html/drupal/sites/all/modules# ls
README.txt
root@drupalteste:/var/www/html/drupal/sites/all/modules# git clone --branch 7.x-1.x https://git.drupal.org/sandbox/rudam/2757401.git formspree
Cloning into 'formspree'...
remote: Counting objects: 90, done.
remote: Compressing objects: 100% (90/90), done.
remote: Total 90 (delta 52), reused 0 (delta 0)
Unpacking objects: 100% (90/90), done.
Checking connectivity... done.
root@drupalteste:/var/www/html/drupal/sites/all/modules# drush upwd admin --password=""
Changed password for admin                                                                                            [success]
root@drupalteste:/var/www/html/drupal/sites/all/modules# drush en -y contact formspree
The following projects have unmet dependencies:                                                                       [ok]
formspree requires jquery_update
Would you like to download them? (y/n): y
Project jquery_update (7.x-2.7) downloaded to /var/www/html/drupal/sites/all/modules/jquery_update.                   [success]
The following extensions will be enabled: contact, formspree, jquery_update
Do you really want to continue? (y/n): y
contact was enabled successfully.                                                                                     [ok]
contact defines the following permissions: administer contact forms, access site-wide contact form, access user contact forms
formspree was enabled successfully.                                                                                   [ok]
jquery_update was enabled successfully.                                                                               [ok]

https://i.imgur.com/OIe8qpZ.gif
https://i.imgur.com/iNfiL2n.jpg

I would love to have this single project manually published even if I wont be granted "vetted user". thank you

rudam’s picture

Status: Closed (won't fix) » Needs review
rajveergangwar’s picture

Hi,

Please create uninstall file to delete your variables.

ipwa’s picture

I need this for a site, would love to see this as a proper project.

rudam’s picture

@ipwa Hey you can use it as sandbox project anyway, Im already using it in my published projects e.g.(http://hmseguros.com.br/contato)
But I would also love to see it as a proper project as well.

feyp’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +PAreview: security

Automated Review

pareview.sh looks good. No automated test cases were found, but this is not a requirement.

Note, that I did update the issue summary with the correct git repository URL, since it changed when you promoted your sandbox project to a full project.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
No: Does not follow the guidelines for project length and complexity.
This has been discussed before and since we are now treating this as an application for a single project promotion, this is not a blocker.
Secure code
No: Does not meet the security requirements. See below for the issue(s) identified.
Coding style & Drupal API usage
  1. (*) XSS: You are passing your settings to your JS as is. You don't filter them using any of the methods provided by the Drupal API and you are not validating them after form submission. This is a major security issue! You should really validate the email address and CSS selector(s) before use and even then filter them for XSS just as a precaution. To test, try the following:
    1. Go to your configuration form and insert <IMG SRC=/ onerror="alert(String.fromCharCode(88,83,83))"></img> into the Apply Formspree to the following elements form element.
    2. Save the form.
    3. You should see a popup displaying XSS immediately, because your JS is also added to your configuration form. Why, btw?
    4. If you navigate to any webform, you should see a popup displaying XSS. No need to submit the form first.
  2. (+) As previously mentioned, implement hook_uninstall() in a formspree.install file to delete the variables you created upon uninstallation of the module using variable_del().
  3. formspree_menu(): Instead of using administer site configuration permission, which is fairly broad, consider to implement hook_permission() to provide your own permission and use that. This would give administrators more fine-grained control over who could configure your module.
  4. formspree_preprocess_page(): Consider implementing hook_form_FORM_ID_alter for webform forms and contact forms to only attach your JS when it is actually needed. You could then also use #attached to add your JS and JS settings, which would allow other modules to alter your modifications, if needed.
  5. formspree_preprocess_page(): Why are you calling drupal_add_js() for each setting individually? You could add both settings in one call.
  6. formspree_preprocess_page(): The DocBlock should read Implements hook_preprocess_HOOK() for page.tpl.php.
  7. formspree.js, line 9: This line should not be needed, since the settings parameter should contain the settings already.
  8. formspree.js: To make your module work with other modules, that use the AJAX API, you should pass the context parameter to your jQuery() calls.
  9. formspree.js: Your validation of required fields works only for contact forms, but it is suggested on the settings page, that you also support webforms. Also, as previously said, there are cases, where your script will submit the form, even though form validation may have failed.
  10. formspree.js: At a first glance, your JS looks simple enough to easily port it to Drupals default jQuery version. Consider doing that to get rid of the jQuery Update dependency.
  11. formspree.js: A way better approach to implement this functionality, would be to alter the forms you want to support using form alter and add an additional submit handler, that will submit the forms to formspree using drupal_http_request(). Also, you could implement several hooks to extend the webform settings for each webform and then track in a custom SQL table, which forms should be submitted to formspree. That way, it would be much easier to make the module secure, you wont have any issues with form validation, since Drupal would only execute your submit handler, when the form is already validated and you would have much more code to show, so it wouldn't be a one-off promition. And your module would be easy to use for people who don't know anything about CSS selectors. Win win situation in my opinion ;).

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

Revision reviewed: 468073e

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

rudam’s picture

Thank you @FeyP I will fix all the stuff you suggested!

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.