/** * User Contact activity. It's for contacting to user directly from profile show page * @author Howard <*****@*****.**> * @static * @param type $params * @return boolean */ public static function contact_profile($params) { $replacements = $params[0]; $notification = new wpl_notifications('email'); $notification->prepare(3, $replacements); /** Disabled **/ if (!$notification->notification_data['enabled']) { return false; } $user = wpl_users::get_user($params[0]['user_id']); $notification->replacements = $notification->set_replacements($replacements); $notification->rendered_content = $notification->render_notification_content(); $notification->recipients = $notification->set_recipients(array($user->data->user_email)); $notification->send(); return true; }
/** * Sends welcome email to user after registeration * @author Howard <*****@*****.**> * @static * @param array $params * @return boolean */ public static function user_registered($params) { $replacements = $params[0]; $notification = new wpl_notifications('email'); $notification->prepare(5, $replacements); /** Disabled **/ if (!$notification->notification_data['enabled']) { return false; } $user = wpl_users::get_user($params[0]['user_id']); $replacements['name'] = isset($user->data->wpl_data) ? $user->data->wpl_data->first_name : $user->data->display_name; $replacements['password'] = $params[0]['password']; $replacements['username'] = $user->data->user_login; $link = wpl_global::get_wp_site_url(); $replacements['site_address'] = '<a target="_blank" href="' . $link . '">' . $link . '</a>'; $notification->replacements = $notification->set_replacements($replacements); $notification->rendered_content = $notification->render_notification_content(); $notification->recipients = $notification->set_recipients(array($user->data->user_email)); $notification->send(); return true; }