- Display a dialog when user approves an image
- Changing A Mockup URL Slug
- Extend Backbone Models, Views, Collections
- Adding Custom Scripts and Styles
- ph_website_publish_thread
- New Comment Threads
- Add additional notification emails
- Welcome message for new users on mockup projects
- Change the subscribed user email based on a role
- Display a dialog when the user submits a comment
- Auto-Close Mockup Comment After New Comment
- Changing the mockup download
- Add Settings To Extensions Page
- Listening for Javscript Events
- Change default mockup project options
- Overriding and Changing Templates
- How to Install SureFeedback & Addons
- How to Update SureFeedback
- Should I Install SureFeedback on My Main Site or a Dedicated Installation?
- Caching and SureFeedback
- Dashboard Shortcode
- Adding A Project Shortcode To Your Site 3.1.x and lower
- Project Shortcode
- Hosting
- Cloudways Compatibility
Change the subscribed user email based on a role
SureFeedback includes filters to change the email users receive when they are subscribed to a project. Here’s an example on how to change it based on role:
<?php
/**
* Change the collaborate subject for project clients
*/
function wp395_ph_change_collaborate_subject( $subject, $email, $user, $post_id ) {
// if user is a project client
if ( user_can( $user, 'project_client' ) ) {
$subject = 'Your Design Project is in progress.';
}
return $subject;
}
add_filter( 'ph_subscribe_user_email_subject', 'wp395_ph_change_collaborate_subject', 10, 4 );
/**
* Change the collaborate message for project clients
*/
function wp987_ph_change_collaborate_message( $message, $email, $user, $post_id ) {
// if user is a project client
if ( user_can( $user, 'project_client' ) ) {
// project link
$project_link = get_the_permalink( $post_id );
// add message
$message = '<p>Your design project is in progress!</p>';
$message .= '<p>' . __( 'View the project here:', 'project-huddle' ) . '</p>';
$message .= '<p><a href="' . esc_url( $project_link ) . '">' . esc_url( $project_link ) . '</a></p>';
}
return $message;
}
add_filter( 'ph_subscribe_user_email_subject', 'wp987_ph_change_collaborate_message', 10, 4 );
These two functions change the subject and the message for the email. You can see how you can change it based on other properties too, like a post id or a specific user id too.
Was this doc helpful?
What went wrong?
We don't respond to the article feedback, we use it to improve our support content.
On this page