Adding custom email alerts

Hello hivepress team,

Does adding mail and triggers be added via child-theme or is it plug in customizations?

Hi,

If you mean how to create additional email events, unfortunately, there is no such feature, you will need a custom implementation Emails - Developer Docs
Filter: hivepress/v1/emails/{email_name} | HivePress Hook Reference
Filter: hivepress/v1/emails/{email_name}/meta | HivePress Hook Reference

Thanks ive forwarded the docs page to my developers, thank you alot!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

The idea is to send an Email to a newly-registered Vendor.
However, since there seems to be no Email Event in HivePress for this, I am using a PHP snippet to send an Email to the user when their user role changes to ‘Contributor’.

The only problem now is that I need the snippet to send an Email I have created in HivePress → Emails. Any idea on how I can point the snippet to Emails in HivePress → Emails?

Here is the PHP snippet I am using:

function user_role_update( $user_id, $new_role ) {
    if ( $new_role == 'contributor' ) {
            $site_url  = get_bloginfo( 'wpurl' );
            $user_info = get_userdata( $user_id );
            $to        = $user_info->user_email;
            $subject   = 'Role changed: ' . $site_url . '';
            $message   = 'Hello ' . $user_info->display_name . ' your role has changed on ' . $site_url . ', congratulations you are now an ' . $new_role;
            wp_mail( $to, $subject, $message );
    }
}
add_action( 'set_user_role', 'user_role_update', 10, 2 );

I just realized that you cannot actually make an Email in HivePress → Emails without selecting an Event. :frowning:
In that case, is there any way to make new Email Events?

Hi,

Please check the solution in this topic.