[buddypress-trac] [BuddyPress Trac] #6915: BP Email template: the unsubscribe link & the account activation email

buddypress-trac noreply at wordpress.org
Wed Feb 17 11:29:46 UTC 2016


#6915: BP Email template: the unsubscribe link & the account activation email
--------------------------+------------------
 Reporter:  imath         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.5
Component:  API           |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------

Comment (by DJPaul):

 The idea with `bp_get_email()` was that it encapsulates the query to fetch
 a `WP_Post` and handles that (which is why it sets
 subject/content/template, because that data comes from the Post). My
 initial thoughts are that I don't like the idea of moving any other data
 into that doesn't directly come from that Post. I like the separation of
 concerns. The recipient details come from another place.

 There's no reason why a more custom implementation of our email system
 could be made by someone who chooses to not use `bp_get_email()`. Perhaps
 they are creating their own `bp_send_email` for use in their own plugin,
 for some reason, and bypass `bp_get_email()` entirely (maybe they aren't
 using Posts to store email content). While this isn't my strongest
 argument ever, moving any part of recipient information or tokens into
 `bp_get_email()` just means more work for someone to copy out of our
 functions and paste it somewhere else (and be baffled why all they need
 isn't in one place to copy from).

 If the goal of patch idea is to provide conditional logic around token
 rendering (plus the blocks of markup around them), I'd rather take the
 time to consider replacing the basic/simple token parsing logic with a
 real Mustache template parser. For example, see
 https://mustache.github.io/mustache.5.html under "Sections" (`{{#person}}`
 etc).

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6915#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list