Closed (won't fix)
Project:
Mail Editor
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2010 at 10:14 UTC
Updated:
27 May 2012 at 21:59 UTC
Hello! Thanks for the much useful module!
There is functionality to use drupal_alter to change the token keys for each email template, but it was not possible to alter the actual values of those keys once the email is being sent.
This patch allows for this functionality. One can use hook_MAIL_TEMPLATE_ID_token_values_alter() to modify the values of each token key.
Please review!
| Comment | File | Size | Author |
|---|---|---|---|
| token_values.patch | 608 bytes | chrisroditis |
Comments
Comment #1
salvisHooks defined by mail_edit should have a name of the form hook_mail_edit_whatever() to avoid potential name conflicts.
Does it make sense to put
$mail['id']into the hook name? This may force the hook client to implement a large number of hooks. For example, the Subscriptions module can easily define a dozen or more IDs (including one for each content type).Comment #2
IRuslan commentedI think it's related to #1501848: Alter tokens by $mailkey_obj->module issue.
Comment #3
IRuslan commentedI propose to use that variants:
drupal_alter($mailkey_obj->module . '_mail_edit_tokens_list', $tokens, $mailkey_obj->id);for alter token list, and
drupal_alter($mail_data->module . '_mail_edit_tokens_value', $tokens, $mail['id'], $mail);for alter token values.
Comment #4
salvisI'm not sure it's a good idea to invest more effort into this, because it's a dead end. The D7 version uses [tokens] (now a core feature which is completely different) — the proprietary !tokens of Mail Editor for D6 are gone.
Any effort you invest into customizing your site based on the !tokens makes it more difficult to port your site to D7 in the future. If we added more hooks in D6 that don't exist in D7, we'd be leading our users down the wrong path.
Comment #5
salvis