I know the maintainer isn't planning on updating this module for 4.7. But i would really like to keep using it. So i tried, with my very limited drupal programming knowledge, to update the module myself. The version posted is giving a blank screen on administer>modules. If you support this effort, please review the code attached and help bringing this module to 4.7

See also How do I mail in 4.7?

CommentFileSizeAuthor
mail_1.module16.92 KBhatseflats
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo’s picture

Hey, if you and others really want mail for 4.7 it probably makes sense to continue it for this release cycle. Thanks for taking on the update. I'll have a look at this if/when I get a chance.

It would be great to have someone to maintain the module for 4.7. Takers? Maybe you'd like to check in with dublindrupaller, who contributed major updates for 4.6. If not I can do some minimal maintenance. But, truth to tell, I've never used the module for anything but testing.

Heine’s picture

I've taken a look at it; there are many parse errors. Why should this module be continued? Won't send + mime mail cut it? If there is a clear rationale, I wouldn't mind to maintain it.

hatseflats’s picture

I've tried send+mime but i couldn't get it to work. Also i really like the send to role fuctionality of this module and i've used it a lot in my 4.6 installation. Basically i run a site with a particular set of registered members, some of these are able to post content (flexinode event types, announcements) and these need to be mailed to all users of a certain role. Using the mail module prevents double work, using this posting on the site and emailing the users can happen at the same time.
If this functionality is offered bij the send module, i should give it an other try. Maybe there are even more options, but i couldn't figure them out. So that's basically why i want this module updated, thanks for the quick response.

davidgibbens’s picture

I'm one of many people interested in the relatively simple functionality (not saying it's easy to implement) of emailing out by role. There are threads and discussions on this around the simplenews module. I say "many people" - I don't know how many but the requests for such a feature/module are scattered around (I did a search on "mail" to find them).

The documentation for the mail module points to send and mimemail but for the life of me I cannot see how they provide the functionality of mailing out by role. Simplenews relies on subscriptions whereas there is a need for something which allows admins to choose who they can send emails to - in fact much simpler than simplenews really. There's an incomplete module called email newslettere too.

I'd really just like to join my voice to those pleading with those of you with the technical ability to produce it that such a module is welcome. And perhaps nedjo - if you are able to update the documentatin of the Mail module - you could just tweak the bit about "send + mime mail" and point people to other modules too such as email newsletter and simplenews.

Thanks.

marcoBauli’s picture

+1 voice to the corus! Would need possibility to send mail by role too

nedjo’s picture

I'm not against a 4.7 version and would welcome a revised patch.

hound’s picture

I wish this was updated to 4.7, too. The Mail 4.6 module did exactly what I wanted. It is really too bad when something useful gets dumped. In fact I have some sites that are stuck at 4.6 specifically because there is no 4.7 mail module that works the same way. What is the status of this project?

nedjo’s picture

Title: First shot at 4.7 » 4.7 upgrade
Status: Needs work » Active

I've committed a basic 4.7 update of the module to CVS HEAD. Please test and report any errors here. When it's ready I'll tag it with 4.7. Meantime you can download the CVS version (it'll be available on drupal.org in a few hours).

nedjo’s picture

Assigned: Unassigned » nedjo
Category: support » task
Status: Active » Fixed

Seems to be working. Please report any remaining problems in separate issues.

hound’s picture

DUDE!! YOU ARE 'THE MAN!!' I will check this asap.

Thanks majorly!

/Hound

hound’s picture

Hmm.. close, but not quite operational yet.

I have a test site with only a few users (all me). As admin, I created a new user and asked Drupal to notify him, which it did via email, so I know that email is working on that server (SMTP, Postfix, etc etc.)

I installed the mail-cvs module, and it does allow me to create an email, and select roles to send it to. I typically put things on the moderation queue rather than post them immediately. It puts a new instance of type 'mail' on the queue, but when I 'publish' the selected item, it never gets sent. No records in Postfix logs, no email, no nothing.

When I go to create a mail item, at the top of the form I see this:

Emailing is not yet enabled for mail posts. An administrator must enable it in the mail content configuration page.

The link to 'mail content configuration page' goes to http://test.mysite.com/admin/node/configure/types/mail - but unfortunately when I click it, I end up at http://test.mysite.com/admin/node - which is the page where you take items out of the moderation queue and actually post them. Ergo there is no place where I can actually enable emailing for mail posts - or at least, not on the link that is displayed.

Hope this is useful. A wish list item for later, also - it would be great if you could toggle something in the Drupal log to indicate each address that an email was sent to for debugging..

Thanks again!

hound’s picture

More info: it doesnt matter if I send the email immediately instead of queuing it for moderation, either - nothing gets sent in either case. I have made sure that I selected all roles, too.

nedjo’s picture

The admin/node/configure/types/mail link was outdated, I've corrected it with the 4.7 equivalent. I've also added a .install file to automatically enable mailing for the mail content type and branched for 4.7. Mailing should now be enabled 'out of the box' (though not on your test site, as you'd already enabled mail.module so it won't run the install file).

Follow the new link to admin/settings/content-types/mail and you'll find the radio button, at or near the bottom, for enabling email.

hound’s picture

Man this is unbelievable! Almost like having a personal valet...heh..

OK will test and get back..btw I am in Boston - where do you reside?

/'Hound'

hound’s picture

Still no mail. I now see the new message "A mail post can be sent to users of selected roles." once I have configured.

Workflow is as follows. Create content/type is 'mail'. Get mail input form. Create title and one line message, 'Dear %username'. Toward bottom, under 'Mail sending options', check off 'email copy of this post', and select all roles. Default publishing options are 'in moderation queue'. Preview and then submit. Go to administer/content. Mail that I just created is there. Check box next to it and select 'publish selected posts.' No mail gets sent, though.

Also, there is no separate .install file in the module gzip that I downloaded (the mail.module is Oct 16, 14:04 and the ActiveMailLib.php file is still from 2005, which is probably fine?)

Thanks!

hound’s picture

oops - error message follows:

* Message Test sent to users with the following roles: administrator, authenticated user.
* Your mail was created.

user warning: Unknown column 'body' in 'field list' query: UPDATE node SET body = 12 WHERE nid = 0 in /var/www/html/drupal-4.7.3/includes/database.mysql.inc on line 120.

hound’s picture

Sorry for fragmented reply. It is working, sort of. Only Admininstrator users received the email test I sent in the above example. The admin-subscribed user (which does NOT display 'authenticated user' on the user's page as a potential group) did not receive it.

hound’s picture

hmm. I tried on another test site. Again, I can send to users of roles other than merely 'authenticated user', but not only that role. Also, I still get the missiing field error, and most significantly, the email is sent as soon as I submit it - rather than when it is approved off the moderation queue - which I suppose I could work around, but is different behaviour from the 4.6 version (and isn't really as good, of course)

/'Hound'

nedjo’s picture

Fixed a few more issues, including the ones noted by hound.

Opened a new issue for only known remaining issue, styling of HTML mail, http://drupal.org/node/89735.

hound’s picture

Hi, Nedjo, still having problems with the most recent mail-cvs (mail.module Oct 17, 6:10)

If I want to send to authenticated users - that is, every registered person on my site - I can't.

When I compose the email, it asks what roles to send to. The role "authenticated user" does not show a check box. (It does send emails to people whose roles I check, but that sort of defeats the purpose of site-wide mailing by administrators, and that isn't how the 4.6 module worked.)

When I go to send, I get this page (with these errors)

----------
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY name' at line 1 query: SELECT name FROM role WHERE rid in () ORDER BY name in /var/www/html/drupal-4.7.3/includes/database.mysql.inc on line 120.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY name' at line 1 query: SELECT name FROM role WHERE rid in () ORDER BY name in /var/www/html/drupal-4.7.3/includes/database.mysql.inc on line 120.

* Message test to authenticated users sent to users with the following roles: .
* Your mail was created.

Submitted by theboss on Tue, 2006-10-17 11:02.

This email was sent to users with the following roles:

Dear %username
» add new comment

------------

Note that the line that tells what roles it was sent to contains no role!

Thank you very much for your efforts on this module!

nedjo’s picture

Applied some further 4.7 upgrade cleanup. Fix validation of role checkboxes. Add base tag in head in HTML mail to make relative links work. Add option to send to all users, not only opted in. Add support for sending to 'authenticated user' role.

hound’s picture

Looking good, almost there! The only thing I see now is that if I create a post of type 'mail' - using my default workflow, which is to put it onto the moderation queue, where it can be reviewed and approved at a later date - the mail will not be sent even when it is approved. I can work around this by previewing and then publishing immediately.

All of the database errors are gone, and the 'send to authenticated users only' mode works as expected. What variable does the 'ignore OPT-IN' check for? I mean, what field in which table?

Thanks a million! I am sure others will be happy too!

Anonymous’s picture

Status: Fixed » Closed (fixed)