• Resolved denialdesign

    (@denialdesign)


    Is it possible to BCC the Account Updated Email to the site admin when a user updates their profile? Is there a hook or function I could add to do this?

    And can the email contain a summary of the changes that were made?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Yurii

    (@yuriinalivaiko)

    Hello @denialdesign

    There is no specific hook for the email headers, but you can use the um_email_send_subject filter hook to modify email headers stored in the UM()->mail()->headers option.

    Try this code snippet:

    /**
    * Add the "Bcc" header to the "Account Updated" email.
    * Send the mail copy to the website admins.
    *
    * @param string $subject Email subject.
    * @param string $template Email template key.
    */
    function my_um_email_changedaccount_email_bcc( $subject, $template ) {
    if ( 'changedaccount_email' === $template ) {
    $bcc = um_multi_admin_email();
    UM()->mail()->headers .= 'Bcc: ' . implode( ',', $bcc ) . "\r\n";
    }
    return $subject;
    }
    add_filter( 'um_email_send_subject', 'my_um_email_changedaccount_email_bcc', 10, 2 );

    There is no easy way to add a summary of the changes to this email. To do this you should replace the um_account_updated_notification function with your custom function and use data from the $changed parameter to add tags and tags_replace pair to the email arguments array. This way you can add support for the custom placeholder in this email template.

    Regards

    Thread Starter denialdesign

    (@denialdesign)

    Thank you kindly!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.