Opened 9 years ago
Closed 9 years ago
#7045 closed defect (bug)
Emails: Allow a custom `unsubscribe` token to be set directly in `bp_send_email()`
Reported by: | r-a-y | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5.0 |
Component: | Emails | Keywords: | commit |
Cc: |
Description
There may be instances where a dev will want to use bp_send_email()
with a custom {{unsubscribe}}
link.
Unfortunately, at the moment, doing something like the following will not work:
bp_send_email( $email_type, 'email@address.com', array(
'tokens' => array(
'unsubscribe' => 'CUSTOM LINK'
)
) );
Attached patch allows this and also adds a Settings component check to the default unsubscribe link.
Attachments (1)
Change History (7)
#2
@
9 years ago
- Milestone changed from 2.5.3 to 2.6
Please be aware of #6932 for 2.6 which also achieves what you want here.
While #6932 is great, it only works for BP core emails.
But, no reason why this change can't get into 2.5.3.
I might be able to workaround this another way. I'm going to hold off on this for 2.6 and let tharsheblows finish work on global unsubscribe functionality before I look into this again.
If you've added bp_is_active, the existing function_exists becomes redundant, right?
Ah yes, good catch! 01.patch
is updated.
#3
@
9 years ago
This doesn't overwrite #6932 I don't think. This sets a default unsubscribe link if one's not already there so they should work together, well at least the last patch I did should be like that. The one comment I have is that some emails cannot be unsubscribed from, so you might want to not put an unsubscribe link on those.
I did #6932 with the idea that you can extend it -- it's just an idea in my head at the moment though. Plugin developers could filter the schemas to add the necessary and then use #7036 to generate the email post then go from there.
Please be aware of #6932 for 2.6 which also achieves what you want here. 2.6 emails will have a custom unsubscribe link for each type of email. But, no reason why this change can't get into 2.5.3. This behaviour wasn't desired.
If you've added
bp_is_active
, the existingfunction_exists
becomes redundant, right?