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

alex.k - April 23, 2009 - 09:30

Sure, a patch would be most welcome. Thanks.

#2

Harry Slaughter - April 23, 2009 - 23:54

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

alex.k - April 27, 2009 - 16:43
Priority:normal» minor
Status:active» postponed

#4

63reasons - April 29, 2009 - 17:09
Assigned to:Anonymous» 63reasons
Status:postponed» active

#5

63reasons - May 6, 2009 - 21:15
Priority:minor» normal
Status:active» needs review

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]

AttachmentSize
user_relationship_mailer.info_.442138.patch 511 bytes
user_relationship_mailer.module.442138.patch 3.9 KB
user_relationship_mailer_defaults.inc_.442138.patch 8.89 KB
user_relationship_mailer_token.zip 1.32 KB

#6

jaydub - May 7, 2009 - 07:03

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

alex.k - May 8, 2009 - 00:32

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

rjbrown99 - July 6, 2009 - 06:19

+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.

 
 

Drupal is a registered trademark of Dries Buytaert.