Hi François,
You can do this using a global. The following will provide all the user tags, prefixed with "recipient_". Eg. recipient_user_username, recipient_user_display_email, etc. After you have created the global, call it in the template:
<%global_name($parent_user_id_fk, "recipient_")%>
sub {
my ($user_id, $prefix) = @_;
$prefix ||= "";
my $user = $DB->table('User')->get($user_id) or return;
GForum::User::normalize($user);
my $return = {};
for (keys %$user) { $return->{$prefix . $_} = $user->{$_} }
$return;
}The global sub can be used anywhere that you have a user ID.
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
You can do this using a global. The following will provide all the user tags, prefixed with "recipient_". Eg. recipient_user_username, recipient_user_display_email, etc. After you have created the global, call it in the template:
<%global_name($parent_user_id_fk, "recipient_")%>
Code:
sub {
my ($user_id, $prefix) = @_;
$prefix ||= "";
my $user = $DB->table('User')->get($user_id) or return;
GForum::User::normalize($user);
my $return = {};
for (keys %$user) { $return->{$prefix . $_} = $user->{$_} }
$return;
}
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com