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
| Comment | File | Size | Author |
|---|---|---|---|
| mailcontrol-after-off.png | 33.96 KB | reszli | |
| mailcontrol-after-on.png | 47.5 KB | reszli | |
| mailcontrol-before.png | 48.33 KB | reszli |
Comments
Comment #1
reszlinew 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
Comment #2
pere orgaHi,
I'm going to do a manual review of your module soon.
Comment #3
reszliHi netol,
I removed the version and cleaned the error messages found by pareview.
thanks for your time!
Comment #4
reszliComment #5
pere orgaLooks good to me, and works.
Comment #6
klausiWe 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 :-)
Comment #7
stborchertSorry, 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:
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:
This will save the email subjects and body values in the correct variables.
Comment #8
reszlithanks 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
Comment #9
monymirzaHi,
mailcontrol.info
remove line 6-7 if there is no dependencies[].
Comment #10
reszlilines 6-7 removed,
thanks monymirza
Comment #11
reszliI 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
Comment #12
balintcsaba commentedModifying 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.
Comment #13
reszliHi 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
Comment #13.0
reszliadded some review bonus links
Comment #14
balintcsaba commentedHi reszli,
A had made the code review and all looks ok for me now.Good luck with your module.
Comment #14.0
balintcsaba commentedfixed git repo link
Comment #15
reszliI 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
Comment #15.0
reszliadded git repo link to D8 version
Comment #16
klausimanual reivew:
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.
Comment #17
reszliThanks 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
Comment #18.0
(not verified) commentedadded another review bonus link