We're working on a patch to make AuthorContact compatible with Mollom. (#553424: Can I use Mollom for this modules Contact Forms?)
It's seems that the only way to add a 'Report as inappropriate'-link to the mails sent by AuthorContact is by copying the mollom_mail_alter function, rename it to authorcontact_mail_alter, and replace the $valid_ids array with an array containing the message id sent by AuthorContact.
Any suggestions for a more flexible way of defining which message id's are concerned?
Extending hook_mollom_form_info() ?
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 791358-mollom-mail-ids.patch | 6.59 KB | dave reid |
| #10 | 791358-mollom-mail-ids-D6.patch | 6.59 KB | dave reid |
| #6 | 791358-mollom-mail-ids-D7.patch | 6.62 KB | dave reid |
| #3 | 791358-mollom-mail-ids-D7.patch | 4.8 KB | dave reid |
Comments
Comment #1
dries commentedI'd be OK with extending
hook_mollom_form_info()with a'mail id' => array('foo', 'bar')or'mail id callback' => '_my_mail_ids'(or something similar).A 'mail id' field would probably cover 90% of the use cases so I don't think we need a callback. The advantage of a callback is that it becomes possible to deal with dynamic mail ids, but I'm not sure that actually exists. In the cases a list of hard-coded ids is not sufficient, people could always fallback on a custom
_mail_alter()function like we do now.Thoughts?
Comment #2
dave reidProviding mail IDs in hook_mollom_form_info() makes a whole lotta sense instead of us hard-coding them. I also agree with just going with the simpler array of mail IDs rather than a callback. Like Dries says other modules can implement hook_mail_alter(). Patch to arrive shortly.
Comment #3
dave reidInitial patch for Drupal 7.
Comment #5
dries commentedThis patch implements what I had in mind, and I think it makes sense to associate the mail ids with the hook_mollom_form_list().
Comment #6
dave reidFixed the exceptions and tested locally.
Comment #7
dave reidI think this one is ready.
Comment #8
pieterdcI think it fits the need.
Ps: I've never seen such a quick feature request response. Wow!
Comment #9
dries commentedCommitted to CVS HEAD. Thanks Dave.
1. Let's backport this patch to DRUPAL-6--1.
2. Would also be good to write some tests but I think we have an issue for testing the mail functionality.
Comment #10
dave reidRe-rolled for D6, tested locally on my install and added the correct report links.
Comment #11
dave reidI don't get it. Do I need to upload with out the '-D6' at the end of the patch file to get it to run for testing? :/
Comment #13
dries commentedThe tests still have ...
* @todo Test mail sending with assertMail() now that it is available.... so it might not be super useful to test this. I'll try to run the test on my local machine.
Comment #14
dries commentedTests passed locally so committed this to DRUPAL-6--1. Thanks Dave.