Use Tokens rather than hard coded string replacments
Harry Slaughter - April 22, 2009 - 21:28
| Project: | User Relationships |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | 63reasons |
| Status: | needs review |
| Issue tags: | token |
Description
I didn't find any tickets requesting this, but it seems pretty reasonable to integrate with the tokens module rather than using static strings (@requestee_name, @requestee_link, etc...) when configuring the notification templates located at admin/user/relationships/settings

#1
Sure, a patch would be most welcome. Thanks.
#2
Yeah, I know I should be submitting a patch :) Unfortunately, it's not a high priority feature for me right now, and I don't have extra time right now, but I wanted to create a ticket for the feature to see if there's any general interest in this.
#3
#4
#5
I have submitted patches for using tokens instead of hardcoded string replacements
Three patch file for user_relationship_mailer module and zip file contains newly added inc file for the token replacements
Thanks [LS]
#6
I'd say that rather than force the use of tokens that the default implementation continue to be supported and IF Token is installed then tokens can be used for replacements as well.
#7
The amount of code needed to keep both implementations would be too much... just think of the maintenance needed when changing any messaging code. So, we should stick to one or the other.
Actually, how much of a stretch is it to include token functionality as part of the move to Notifications/Messaging framework? This was identified in http://drupal.org/node/344366#comment-1456188. Then, we can keep user_relationship_mailer as is, and use the token goodness with Notifications.
#8
+1 for token support.
Why? Because of the integration with the content profile module. If you have a CCK-based profile with fields for first name, last name, and others it would be a very standard and nice integration to be able to call upon them via the token module. The customized e-mails will look a lot better.
I'm going to test the patch with the latest release of code. Thanks for submitting it.
It sounds like the longer-term plan based on the above link is to create a sub-module to enable messaging/notifications/token integration. I'm all for that if it works - whatever gets tokens into this is good for me.