heimrichhannot/contao-notification_center_plus

扩展通知中心,增加额外功能。

1.7.0 2024-02-16 09:47 UTC

README

扩展通知中心,增加额外功能。

通用功能

  • 可以定义标题和内联CSS(支持自动内联)
  • 为当前登录的前端用户和表单添加额外的问候语标记(##salutation_user##, ##salutation_form##)
  • 忘记密码模块现在有单独的跳转用于更改密码
  • 可以从通知中心标记动态生成ics文件,并将其添加到附件中

标记

将自动生成的ICS文件添加到通知附件中

  1. 像往常一样创建您的通知。
  2. 将标记 ##ics_attachment_token## 添加到消息的 tl_nc_language 记录中的附件标记,并在表单底部激活选项。
  3. 现在您可以根据需要将标记添加到不同的字段。

上下文标记

通知中心+添加上下文标记,如环境变量和页面信息到标记数组中,因为这些信息在稍后通过cron发送时不可用。

if, then, else

如果您想在消息内部检查条件,可以使用以下示例

Association: {if form_association!=''}##form_association##
{else}unknown
{endif}

提示

{if form_association!=''}

  • 必须为L-Value不使用引号
  • 必须在L-Value和运算符之间没有空格
  • 必须在运算符和R-Value之间没有空格
  • L-Value或R-Value代表标记数组中的键 $arrData['form_association'] = 'heimrichhannot'

使用可覆盖的haste_plus属性

您现在可以选择使用在 heimrichhannot/contao-haste_plus 中可用的可覆盖属性,也可以在此模块中使用。只需将类似以下代码添加到 "sendNotificationMessage"-钩子中即可

public static function sendNotificationMessage(Message $objMessage, &$arrTokens, $strLanguage, $objGatewayModel)
{
    $arrTokens['overridableProperties'] = ['email_sender_address', 'email_sender_name', 'email_replyTo', 'email_subject'];
    $arrTokens['overridableEntities'] = [['tl_calendar_events', $intEventId]];
}

$objEvent 是您在dca中调用 General::addOverridableFields() 以添加来自其他dca的可覆盖字段的实体。请参阅 heimrichhannot/contao-haste_plus 中的 General::addOverridableFields()General::getOverridableProperty() 以获取更多详细信息。