在SuiteCRM中创建提醒功能

菜单栏中的警报是引起用户注意的绝佳方式。如果您要通过代码创建自定义警报怎么办?这很容易,这是如何做到的。

随着SuiteCRM 7.3的发布,发布了Alerts。这些在SuiteCRM中显示为菜单栏中的小徽章:

由于这些只是存储为bean,我们可以通过简单地创建具有适当值的新记录并保存来添加通知。例如:例

<?php
$alert = BeanFactory::newBean('Alerts');
$alert->name = 'My Alert';
$alert->description = 'This is my alert!';
$alert->url_redirect = 'index.php';
$alert->target_module = 'Account';
$alert->assigned_user_id = '1';
$alert->type = 'info';
$alert->is_read = 0;
$alert->save();

调用此方法可用于为特定用户创建警报,如下所示:

滚动至顶部