Email Blacklist provide administrator to configure blacklisted users email ids, to whom system will never send any type of mail.

Features:

  • Administrator can add/remove blacklisted users email ids.
  • System will automatically detect blacklisted email ids and it will not allow to send any email to those users.

The sandbox project URL : https://drupal.org/sandbox/vishal_yug/2204461

Setting Git Repo:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/vishal_yug/2204461.git email_blacklist
cd email_blacklist

Reviews of other projects:-
https://drupal.org/comment/8521287#comment-8521287
https://drupal.org/comment/8522989#comment-8522989
https://drupal.org/comment/8565097#comment-8565097

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gobinathm’s picture

Status: Needs review » Needs work

vishal_yug, there are few problem with the project application & module.

1. info file contains module version, this is discourage as drupal.org package manager automatically does this.
2. You need to follow the checklist for application submission. http://pareview.sh/pachecklist
3. Application with Review Bonus takes highest priority. You can review other project application & provide those links in your description. Please review minimum of 3 application.
4. PAReview is reporting issue on the code. Please see http://pareview.sh/pareview/httpgitdrupalorgsandboxvishalyug2204461git
5. Module have minor functional issue. eg. when i tried to enter 4 email id's in configuration, it only stored 2.

once you are done with all the fixes change the status to Needs Review

contactvishaljain’s picture

Issue summary: View changes
contactvishaljain’s picture

Issue summary: View changes
contactvishaljain’s picture

Issue summary: View changes
FileSize
11.98 KB
contactvishaljain’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
contactvishaljain’s picture

Status: Needs work » Needs review

Errors found by Pareview fixed and other issues also fixed.

Fernly’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

Hi vishal_yug,

I removed the PAReview: review bonus tag. You need 3 reviews to use this tag.
Also remove your username from the git clone link.

Manual review

  1. If the module is about blocking registered email addresses, I have my doubts on the implementation of the idea. If this is the case, wouldn't it be more interesting to flag email addresses of users on user object level instead of dumping the email ids in a separate db table? There are quite some direct database calls for the functionality of this module.
  2. email_blacklist.admin.inc line 10: You can remove the parameter $form.
contactvishaljain’s picture

Hi lennartvv,

I have corrected the $form as point 2.

For point #1, This module is intended for both registered user as well as non-registered users. For a non-registered users may be arise in some cases like (Tell a friend, Promotional emails etc.). So I have created a separate db table to store those blacklisted email ids.

contactvishaljain’s picture

Status: Needs work » Needs review
contactvishaljain’s picture

Issue summary: View changes
contactvishaljain’s picture

Issue summary: View changes
alinouman’s picture

Status: Needs review » Needs work

1- you are not validating email address while submitting value in admin form.
2- project is too short to approve you as full module creator. May be git admin approved this only project for you.
3- Do 3 manual review and add review tag.

contactvishaljain’s picture

Thanks, alinouman,

1. I have add the validation of email ids that are saved, under the admin configuration.
2. I know the project its short but once its first release we can add email (module key) based blocking of email sent out. That will be more useful.

contactvishaljain’s picture

Status: Needs work » Needs review
contactvishaljain’s picture

Issue summary: View changes
TanvirAhmad’s picture

I am not sure which IDE you are using, but I cheked it usin NetBeans, and found your code formating issue with function email_blacklist_mail_alter, here

$count = db_select('email_blacklist', 'k')
        ->condition('k.mail', $mail)
        ->countQuery()
        ->execute()
        ->fetchField();

are not properly formated.

TanvirAhmad’s picture

Status: Needs review » Needs work
contactvishaljain’s picture

Hi TanvirAhmad,

I have checked with Netbeans IDE and fixed the formatting stuff.

contactvishaljain’s picture

Status: Needs work » Needs review
subhojit777’s picture

Fix the code review issues: http://pareview.sh/pareview/httpgitdrupalorgsandboxvishalyug2204461git

Rather than creating a new table for storing blacklist email addresses, why do not make use of variables table. Create a system setting form (https://api.drupal.org/api/drupal/modules!system!system.module/function/system_settings_form), this way the setting will be stored in a variable. You can then easily check settings through variable_get(). This way you can make more use of Drupal API.

It would be good to keep all .inc files in a separate directory calles includes. Keep admin.inc file inside includes directory.

SGhosh’s picture

Status: Needs review » Needs work
FileSize
1.68 KB

Cleaned up the code for the admin form validate function. Attaching a patch for the same. Please do refer the patch, test it and may be use it too :)

Code changes and reasons for the same -
* added required to the email form field
* instead of replacing new line with comma and splitting on comma, split directly on new line or whitespace
* if incorrect email found, break loop
* no need of changing form field value in $form_state variable

More feedback coming up after some more review :)

Feedback

  1. no need to store in a new table, instead store in the variables table - as visibility rules are stores
  2. could store as a comma or new line separated list but in a single variable
  3. have custom validate function for checking email ids, before saving to db
  4. another advantage, single write to db on save.
  5. only check 'to' email ids, must also check cc and bcc email ids.
  6. to could have mutiple email addresses
  7. Please run the drupal coder module. Following errors turned up
    • email_blacklist/email_blacklist.admin.inc
    • --------------------------------------------------------------------------------
    • FOUND 12 ERROR(S) AFFECTING 7 LINE(S)
    • --------------------------------------------------------------------------------
    • 45 | ERROR | Whitespace found at end of line
    • 46 | ERROR | Spaces must be used to indent lines; tabs are not allowed
    • 46 | ERROR | Line indented incorrectly; expected 4 spaces, found 1
    • 47 | ERROR | Spaces must be used to indent lines; tabs are not allowed
    • 47 | ERROR | Line indented incorrectly; expected 6 spaces, found 2
    • 47 | ERROR | No space found after comma in function call
    • 48 | ERROR | Spaces must be used to indent lines; tabs are not allowed
    • 49 | ERROR | Spaces must be used to indent lines; tabs are not allowed
    • 49 | ERROR | Whitespace found at end of line
    • 50 | ERROR | Spaces must be used to indent lines; tabs are not allowed
    • 50 | ERROR | Line indented incorrectly; expected 4 spaces, found 1
    • 52 | ERROR | Closing brace indented incorrectly; expected 1 spaces, found 4
  8. Add inline comments to hook_mail_alter for the implementation.
SGhosh’s picture

Updated previous. Please ignore this.

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.