Overridding Email Tokens
-
Hi,
Im using bp_send_email() to send custom email to people would fill out a form. I followed this tutorial(https://codex.buddypress.org/emails/custom-emails/) and everything seems for fine except one thing.
I cannot over ride the salutation, more specificly {{recipient.name}}, I understand that the function takes this info directly from the WP_USER object, and it seems to be the display name.
I tried doing many things, the problem is that people who are sent email are not always current users of the site, and i do not want to have to create a whole new email system for just a few emails.
So what I am trying to do and send an WP_USER object to bp_send_email(), and everything works find, again accept the {{recipient.name}}.
Here is the following code:
$user = new WP_User(0); $user->display_name = "display_name"; $user->first_name = "first_name"; $user->last_name = "last_name"; $user->user_nicename = "user_nicename"; $user->user_email = "user@email.com"; $user->nickname = "nickname"; bp_send_email('email_taximony', $user, $args);
I also tried setting recipient.name in the args with no luck.
Thanks,
- You must be logged in to reply to this topic.