Opened 8 years ago
Closed 8 years ago
#7431 closed enhancement (fixed)
Hook for custom email type schema
Reported by: | finzend | Owned by: | DJPaul |
---|---|---|---|
Milestone: | 2.8 | Priority: | high |
Severity: | blocker | Version: | 2.7.2 |
Component: | Emails | Keywords: | has-patch |
Cc: |
Description
Hi,
I have added a custom notification (for a custom post type) including a new setting in the e-mail notification screen, so users can get alerted by email. I've added the new bp-email template and everything worked fine, except the 'new' unsubscribe link from #6932
The link is generated by a user_id and a notification type. This type is looked up via the function bp_email_get_type_schema.
It seemed I had to add a type to bp_email_get_type_schema, after that the unsubscribe link worked. But I had to update/change the code in bp-core-functions, because there wasnt any hook available. Could such a hook/action be implemented?
Attachments (1)
Change History (6)
#1
@
8 years ago
- Component changed from Core to Emails
- Milestone changed from Awaiting Review to 2.8
- Owner set to DJPaul
- Priority changed from normal to high
- Severity changed from normal to blocker
#2
@
8 years ago
- Keywords has-patch added
We've been telling people to use the bp_core_install_emails action to install their emails... so will need to introduce some kind of internal-only flag to prevent this happening.
Attached patch may be shortsighted, but it would allow the schema to be filtered for unsubscribe functions without interfering with current/recommended install procedures or unnecessarily complicating bp_email_get_type_schema()
.
Hi. Er, gosh. You're correct. We'll have to think about this quickly.
The problem with adding a filter to
bp_email_get_type_schema
(though this is likely the best way to go) will mean that your custom emails will get installed via the call at the top of thebp_core_install_emails
function. We've been telling people to use thebp_core_install_emails
action to install their emails... so will need to introduce some kind of internal-only flag to prevent this happening.Thank you very much for letting us know @finzend !