Is there a way to style the emails?
-
We would like to customize the email that goes out when someone comments on a doc. Is there a way to do this?
-
Hi, the email is sent by WordPress, so any of the plugins or techniques that are used to style WP’s emails will also change the email you are trying to change. There are tons of options, so the hardest part may be choosing one. ??
i was looking through all the buddypress email stuff. Didnt think to look for a worpress option.
any method you like the best or have the most luck with? I only really messed with woo ones like kadance.
-
This reply was modified 5 months, 2 weeks ago by
coldrealms65.
Hi, I don’t really have a favorite. There are so many WP email-improvers that all seem to work ok–it’s more a matter of which features you like. For instance, the deliverability of basic WP emails (because they’re sent from a random, anonymous server, has nothing to do with the WP code) is poor unless you add some important DNS records that help “verify” your sent emails. So, if you’re working on emails, I’d consider using one of the plugins that improves deliverability, too, by sending emails using SMTP or adding the important headers.
that is the first step for any site ?? These days gmail will trash everything that hasnt been run through a proper system.
We have all the other emails looking great, just need yours then the client gets the site.
ill give a few a test drive and let you know how it goes.
so I have tried a few and they all have the same issue. notifications go out to all users not just users for that specific group.
I could really use a reccomendation of one that works with docs that respects who is supposed top get notifications…
question adjacent:
Is this possible?- Is it possible when someone adds a new doc to have the description in the activity feed? So it doesn’t just say the doc name and that it was posted? When a comment is posted, it shows the comment in the feed. Would be nice to have some kind of description of docs posted as well.?
Sure, you can change the doc_created activity item output. Here’s the existing function: https://github.com/boonebgorges/buddypress-docs/blob/master/includes/activity.php#L320
Here’s a note about setting activity actions in BP: https://codex.buddypress.org/developer/function-examples/bp_activity_set_action/
Regarding your comment notifications, they should only be going out to the doc author. Check to see that there aren’t some other filters changing that behavior in one of your plugins. (It would be weird for a plugin to change the core WP comment notification behavior.)Thanks for the reply.
So in this section:function bp_docs_format_activity_action_bp_doc_created( $action, $activity ) {
if ( empty( $activity->secondary_item_id ) ) {
return $action;
}
$doc = get_post( $activity->secondary_item_id );
if ( ! $doc ) {
return $action;
}
$user_link = bp_core_get_userlink( $activity->user_id );
$doc_url = bp_docs_get_doc_link( $activity->secondary_item_id );
$doc_link = sprintf( '<a href="%s">%s</a>', $doc_url, $doc->post_title );
$action = sprintf( __( '%1$s created the doc %2$s', 'buddypress-docs' ), $user_link, $doc_link );
return $action;
}I assume i would add something like:
function bp_docs_format_activity_action_bp_doc_created( $action, $activity ) {
if ( empty( $activity->secondary_item_id ) ) {
return $action;
}
$doc = get_post( $activity->secondary_item_id );
if ( ! $doc ) {
return $action;
}
$user_link = bp_core_get_userlink( $activity->user_id );
$doc_url = bp_docs_get_doc_link( $activity->secondary_item_id );
$doc_link = sprintf( '<a href="%s">%s</a>', $doc_url, $doc->post_title );
// Get the excerpt of the document
$doc_excerpt = $doc->post_excerpt;
// If the excerpt is empty, generate one from the content
if ( empty( $doc_excerpt ) ) {
$doc_excerpt = wp_trim_words( $doc->post_content, 55, '...' );
}
$action = sprintf( __( '%1$s created the doc %2$s: %3$s', 'buddypress-docs' ), $user_link, $doc_link, $doc_excerpt );
return $action;
}But, I am only as good a programmer as my ability to ask chatgpt so i don’t know if that5 is even close to correct ??
So it looks like there is some issues with the basic Buddy press template packs. Legacy works for the changes you described however Nouveau is overriding your plugin’s activity feed settings.
We have to use Nouveau due to theme requirements so any thoughts on how to make your activity compatible with Nouveau?
-
This reply was modified 5 months, 2 weeks ago by
- You must be logged in to reply to this topic.