I want add some variables for subscriptions mail templates without modification of original modules (subscriptions and mail_edit).
After read some documentation (thanks to develCuy) and research module code, i understand that must add following hooks to my module:
- hook_subscriptions_get_mailvars (with $object parameter) to give my mail variables during notification emails generation
- hook_subscriptions() with subhook_fields for my variables definition.
I'm right? Or additional steps are necessary for implementation this?
Yours faithfully and gratitude for very useful module!
Comments
Comment #1
salvishook_subscriptions_get_mailvars is all you really need.
Look at subscriptions_cck.module, it does exactly what you want to do. Should be straight-forward.
Be aware that this is likely to change for D6.
Thanks for the recognition!
Comment #2
Libra commentedsalvis, thanks for promt reply! In the beginning I thought, that it will be not a challenge, but I am a little having investigated the module and could not understand how to solve a problem. We use a site inside of the company and it's accessible by the internal domain - accordingly in notification emails to employees of the company logically to specify the internal domain whereas it is necessary for other users to specify the external domain. Thus, it is necessary by email address (or category) of recipient to form all URLs, but at use subscriptions hooks the email of recipient is not accessible anywhere. Or I am mistaken?
But the given problem can be realized easier - by the hook_mail_alter - simply process mail body and replace all URLs :)
Comment #3
salvisAh, you'd like to change existing variables, not add new ones? Yes, hook_mail_alter is probably the way to go, and no, I don't see any good way to get at the recipient through Subscriptions either. Maybe in D6...
Comment #4
Libra commentedOk, i'll use hook_mail_alter. Thank for support!