Email Token to Display a Members Avatar – Error occured
-
Hello,
I want to create an email-token to display a member avatar in a bp-custom-mail.
I tried to implement snippets from this tutorial, but maybe I don’t understand everything correctly.
1) I created a single-bp-email.php with custom html content which works fine.
There I can add the output whereever I want the avatar to be displayed <?php bp_email_avatar(); ?>, right?2) To my bp-custom.php I added this function:
function bp_email_avatar() { $token = '{{recipient.avatar}}'; printf( '<img src="%s">', $token ); }
Have a look at my bp-custom.php:
https://1drv.ms/u/s!AikSNhBAk4teugLf_yT-8610eUDC$formatted_tokens['recipient.avatar'] = bp_core_fetch_avatar( array( 'object' => 'user', 'item_id' => $formatted_tokens['initiator.id'], 'html' => false, ) );
=> The last snippet results in a php-error.
Could you help me to make this work?
Thanks in advance,
Chris
- You must be logged in to reply to this topic.