[buddypress-trac] [BuddyPress Trac] #7044: Emails: Passing an email address to `bp_send_mail()` does not render `{recipient.name}` token
buddypress-trac
noreply at wordpress.org
Mon May 2 23:33:15 UTC 2016
#7044: Emails: Passing an email address to `bp_send_mail()` does not render
`{recipient.name}` token
--------------------------+--------------------
Reporter: r-a-y | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.5.3
Component: API - Emails | Version: 2.5.0
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+--------------------
Changes (by DJPaul):
* type: defect (bug) => enhancement
Comment:
Not actually a bug; this was intended.
I think my idea was that if you passed a user ID to any of the email
fields, then you'd know the ID would definitely exist, but if you passed
an email, you did not know if it belonged to a user on the site. This is
why, where possible, we pass a user ID when we send email.
However, presumably you've found it more convenient to pass an email
address in some case, so I have no problems with support being added.
It'd be best to implement this in `class
BP_Email_Recipient->__construct()` -- which will require substantial
refactoring, and new tests for the support you're adding -- instead of
`bp_email_set_default_tokens()`.
I think you'll be able to use the `class BP_Email_Recipient->get_user()`
method to help. If you're setting the user name and user email from a real
user, please also set the user object property.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7044#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list