<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Notifire通知管理簡化

          聯(lián)合創(chuàng)作 · 2023-10-01 04:02

          Notifire 是一個開源庫,用于使用單個 API 管理多渠道事務通知。為 Node.js 構建的簡單易用的 OCL,易于使用的模板,不再有供應商鎖定,統(tǒng)一的 API。

          目標是簡化通知并為開發(fā)人員提供工具以在系統(tǒng)與其用戶之間創(chuàng)建有意義的通信。

          特性:

          • 適用于所有消息傳遞提供商的單一 API(電子郵件、短信、推送、直接)
          • 輕松管理多個渠道的通知
          • 配備用于高級布局和設計的模板引擎
          • 缺失變量的內置保護
          • 易于設置和集成
          • 用 TypeScript 編寫,具有可預測的靜態(tài)類型。
          • 社區(qū)驅動
          import { Notifire, ChannelTypeEnum } from '@notifire/core';
          import { SendgridEmailProvider } from '@notifire/sendgrid';
          
          const notifire = new Notifire();
          
          await notifire.registerProvider(
            new SendgridEmailProvider({
              apiKey: process.env.SENDGRID_API_KEY,
              from: '[email protected]'
            })
          );
          
          const passwordResetTemplate = await notifire.registerTemplate({
            id: 'password-reset',
            messages: [
              {
                subject: 'Your password reset request',
                channel: ChannelTypeEnum.EMAIL,
                template: `
                    Hi {{firstName}}!
                    
                    To reset your password click <a href="{{resetLink}}">here.</a>
                    
                    {{#if organization}}
                      <img src="{{organization.logo}}" />
                    {{/if}}
                `
              },
            ]
          });
          
          await notifire.trigger('<REPLACE_WITH_EVENT_NAME>', {
            $user_id: "<USER IDENTIFIER>",
            $email: "[email protected]",
            firstName: "John",
            lastName: "Doe",
            organization: {
              logo: 'https://evilcorp.com/logo.png'
            }
          });
          
          瀏覽 27
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  在线综合网 | 免费黄色片子 | 久久久精品欧美 | 国产精品一区二区三区四区 | 日韩AV东京热一 |