Code-Snippets-Functions/Execute a function on a child site/Ultimate Member/receive-email-notification-when-user-updates-their-form.txt

21 lines
477 B
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

add_action( 'um_after_user_updated',function( $user_id, $args, $to_update ){
ob_start();
?>
<table>
<tbody>
<?php foreach( $to_update as $metakey => $metavalue ): ?>
<tr>
<th><?php echo $metakey; ?>:</th>
<td><?php echo $metavalue; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$contents = ob_get_contents();
ob_end_clean();
$admin_email = UM()->options()->get( admin_email );
wp_mail( $admin_email,'Profile updated', $contents );
},9,3);