Drupal version: 7 & 8

Description
Have 100% control over the default mails sent by Drupal 7/8 out of the box.

This small module extends original Drupal 7/8 account settings page with the ability to turn ON/OFF all standard mails. By default Drupal 7/8 provides no option to disable welcome emails, account cancellation confirmation or password reset.
This can be useful when you don't want to send those emails, or you are sending them through some external services or just for development purposes, etc.
You can access these settings under admin/config/people/accounts.
The module provide only interface modifications. The underlying functionality is already there by default in Drupal 7/8.

A link to project page:
http://drupal.org/sandbox/reszli/1846498

A direct link to git repository:
D7:
git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/reszli/1846498.git mailcontrol
D8:
git clone --recursive --branch 8.x-1.x http://git.drupal.org/sandbox/reszli/1846498.git mailcontrol

Review bonus:
http://drupal.org/node/1862664#comment-6827878
http://drupal.org/node/1862664#comment-6831940
http://drupal.org/node/1862664#comment-6842454

Comments

reszli’s picture

new direct link to git: (switched to new branch)
git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/reszli/1846498.git mailcontrol

pere orga’s picture

Status: Needs review » Needs work

Hi,

I'm going to do a manual review of your module soon.

reszli’s picture

Hi netol,

I removed the version and cleaned the error messages found by pareview.
thanks for your time!

reszli’s picture

Status: Needs work » Needs review
pere orga’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, and works.

klausi’s picture

We are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)

stborchert’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, but this module is not really working.
After enabling it the email subjects and bodies are not saved anymore. This is because you move the fields into fieldsets and do not set the variable name within the new structure. Drupal translates the structure then to variables named "0" and "1" and saves the email texts into this new variables.

Example:

<?php
$form['email_admin_created']['settings'][] = $form['email_admin_created']['user_mail_register_admin_created_subject'];
?>

On submit Drupal (especially system_settings_form_submit extracts a variable called "0" (because you are adding $form['email_admin_created']['user_mail_register_admin_created_subject'] to an array without specifying a key).

Instead doing the above try this:

<?php
$form['email_admin_created']['settings']['user_mail_register_admin_created_subject'] = $form['email_admin_created']['user_mail_register_admin_created_subject'];
?>

This will save the email subjects and body values in the correct variables.

reszli’s picture

Status: Needs work » Needs review

thanks stBorchert for the good catch!
I fixed the field naming and now they all get saved correctly in their respective variables
also re-run the pareview test on ventral.org: http://ventral.org/pareview/httpgitdrupalorgsandboxreszli1846498git

monymirza’s picture

Status: Needs review » Needs work

Hi,

mailcontrol.info
remove line 6-7 if there is no dependencies[].

reszli’s picture

Status: Needs work » Needs review

lines 6-7 removed,
thanks monymirza

reszli’s picture

I updated the module page with some more details and instructions:
http://drupal.org/sandbox/reszli/1846498

please refer to the following links that prove, there is a need for this simple module:
http://drupal.stackexchange.com/questions/3070/disable-register-email-no...
http://stackoverflow.com/questions/4821063/how-do-i-disable-the-confirma...
http://jomcode.com/fadhil/programming-and-development/disabling-email-no... (he calls Drupal stupid!)

also the discussion to have similar functionality in D8 core:
#901518: Option to disable welcome emails and messages

balintcsaba’s picture

Status: Needs review » Needs work

Modifying the form structure of a core form is not a good idea in general.
You are moving the subject and body fields into a container.
Other modules may want to alter the same form, and will not find the elements in their desired position.
This could cause a conflict between your and some other modules.

I think you should apply the #states separately on the fields, without moving them.

reszli’s picture

Status: Needs work » Needs review

Hi balintcsaba,

you have a point there!
+ I originaly added the containers to reproduce the structure of the emails that by default have the on/off chekbox
+ so now I modified the code and removed the additional containers, this way the form structure remains the same, so any other module can work with it further
+ functionality and UX of the module remains the same

please review,
reszli

reszli’s picture

Issue summary: View changes

added some review bonus links

balintcsaba’s picture

Status: Needs review » Reviewed & tested by the community

Hi reszli,

A had made the code review and all looks ok for me now.Good luck with your module.

balintcsaba’s picture

Issue summary: View changes

fixed git repo link

reszli’s picture

I also created a 8.x.1.x branch and tested under D8
+ the same code works for D8 as well with a small change in the info file for core version
+ code formatting stays OK: http://ventral.org/pareview/httpgitdrupalorgsandboxreszli1846498git-8x-1x

reszli’s picture

Issue summary: View changes

added git repo link to D8 version

klausi’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +PAreview: single application approval

manual reivew:

  • mailcontrol_uninstall(): not sure you should delete those variables since they are not strictly provided by your module.
  • 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.

Thanks for your contribution, reszli!

I promoted your sandbox to a full project: http://drupal.org/project/mailcontrol

Now that this experimental project has been promoted, you'll need to update the URL of your remote repository or reclone it.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

reszli’s picture

Thanks klausi,

I'm happy that the module was promoted!
and I understand it was a short one, but it was a good start to gain experience in this process.
I'll be back soon with a larger project.

bests,
reszli

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

Anonymous’s picture

Issue summary: View changes

added another review bonus link