Opened 5 years ago
Closed 5 years ago
#8428 closed feature request (fixed)
Allow to trigger email for activation
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 8.0.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Emails | Keywords: | has-patch commit |
| Cc: |
Description
Welcome email can be a nice core feature which we can use to send email after email verification.
Trigger for activation_completed
ref: https://github.com/robertstaddon/buddypress-welcome-email
Attachments (6)
Change History (14)
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
5 years ago
This ticket was mentioned in Slack in #buddypress by vapvarun. View the logs.
5 years ago
#4
@
5 years ago
- Keywords has-patch needs-refresh added; needs-patch removed
Hi @vapvarun
Thanks for your work on this initial patch, sorry for the delay of this first feedback. The first improvement I see is about generating the email post type item when updating to BuddyPress 8.0. FYI, I've already added a function to perform some tasks during this step. Have a look at the bp_update_to_8_0() function into the src/bp-core/bp-core-update.php file.
1) Instead of what you're doing with bp_add_welcome_email(), I believe the right strategy would be to use the bp_core_install_emails() function making sure to add a filter on bp_email_get_schema to only keep the welcome email you've described in it.
eg:
function bp_core_get_welcome_email_schema( $emails ) {
return array( 'core-user-activation' => $emails['core-user-activation'] );
}
function bp_update_to_8_0() {
// after the activity migrating code
add_filter( 'bp_email_get_schema', 'bp_core_get_welcome_email_schema' );
bp_core_install_emails();
remove_filter( 'bp_email_get_schema', 'bp_core_get_welcome_email_schema' );
}
PS: I think 'core-user-activation' is enough. You don't need to add a -completed suffix.
2) I think a better place for the function to send the activation email would be after the bp_members_add_role_after_activation(). And I think your should rename it to bp_members_send_welcome_email()
3) About the tokens/message content, I believe including xProfile field values might not be a good idea in some cases, eg: a minimal signup form with only the base profile field. So I believe we should think about a standard welcome message informing about the useful links for the user regarding the active component. A {{{message}}} token could be use like what we're doing in the messages_notification_new_message() function.
@
5 years ago
Generalize name up 8.0 email schema upgrade filter function. Harmonize names & keys of welcome email so that upgrade completes without errors.
#6
@
5 years ago
- Keywords needs-testing added; needs-refresh removed
@vapvarun & @dcavins thanks for updating the patch. I believe we should improve the email message some more words about how to reset the password with a link to do it. New members always forget their password!
Otherwise it looks pretty nice. I'll try to test it asap 👍
Situation to trigger email after activation