Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to customize links on footer? #210

Open
levycarneiro opened this issue Apr 17, 2021 · 2 comments
Open

Way to customize links on footer? #210

levycarneiro opened this issue Apr 17, 2021 · 2 comments

Comments

@levycarneiro
Copy link

Is there a way to customize the links on the footer?

Screen Shot 2021-04-17 at 12 01 03 PM

Looking to customize the Text of these links.

Thanks.

@boonebgorges
Copy link
Owner

See the function ass_bp_email_footer_html_unsubscribe_links(). We generate the links dynamically, so you'll have to unhook this filter and introduce your own that does something similar. @r-a-y Am I understanding this correctly?

@r-a-y
Copy link
Collaborator

r-a-y commented Jul 7, 2021

See the function ass_bp_email_footer_html_unsubscribe_links(). We generate the links dynamically, so you'll have to unhook this filter and introduce your own that does something similar. @r-a-y Am I understanding this correctly?

Sorry. I didn't see this message until just now. Yes, that's correct.

To unhook the default footer links and roll your own, use the following:

add_action( 'bp_ges_before_bp_send_email', function() {
	// unhooks default GES email footer
	remove_action( 'bp_after_email_footer', 'ass_bp_email_footer_html_unsubscribe_links' );

	// add our custom email footer
	add_action( 'bp_after_email_footer', 'my_custom_email_footer' );
} );

function my_custom_email_footer() {
	$tokens = buddypress()->ges_tokens;

	// Bail if this isn't a group subscription email.
	if ( ! isset( $tokens['subscription_type'] ) ) {
		return;
	}

	// do your custom footer routine here.
	// to determine what type of email this is use: $tokens['subscription_type']
}

If you're just looking to customize the text, you should look into using a custom localization file (.pot file) or use the 'gettext' filter to change the strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants