<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 郵件內容 ### [](https://octobercms.com/docs/services/mail#message-content)留言內容 可以使用郵件視圖或郵件模板在十月份發送郵件。郵件視圖由**/ views**目錄中文件系統中的應用程序或插件提供。而郵件模板是通過后端界面通過*系統>郵件模板*進行*管理的*。所有郵件都支持使用Twig進行標記。 可以選擇使用此方法[在插件注冊文件中注冊](https://octobercms.com/docs/services/mail#mail-template-registration)郵件視圖`registerMailTemplates`。這將自動生成一個郵件模板,并允許使用后端界面對其進行自定義。 ### [](https://octobercms.com/docs/services/mail#mail-views)郵件檢視 郵件視圖駐留在文件系統中,所使用的代碼表示視圖文件的路徑。例如,使用代碼**author.plugin :: mail.message**發送郵件將使用以下文件中的內容: ~~~ plugins/ <=== Plugins directory author/ <=== "author" segment plugin/ <=== "plugin" segment views/ <=== View directory mail/ <=== "mail" segment message.htm <=== "message" segment ~~~ 郵件視圖文件中的內容最多可以包括3個部分:**配置**,**純文本**和**HTML標記**。各節按`==`順序分開。例如: ~~~ subject = "Your product has been added to OctoberCMS project" == Hi {{ name }}, Good news! User {{ user }} just added your product "{{ product }}" to a project. This message was sent using no formatting (plain text) == <p>Hi {{ name }},</p> <p>Good news! User {{ user }} just added your product <strong>{{ product }}</strong> to a project.</p> <p>This email was sent using formatting (HTML)</p> ~~~ > **注意:**郵件視圖中支持基本的Twig標簽和表達式。 的**純文本**部分是可選的,一個視圖可以僅包含在配置和HTML標記部分。 ~~~ subject = "Your product has been added to OctoberCMS project" == <p>Hi {{ name }},</p> <p>This email does not support plain text.</p> <p>Sorry about that!</p> ~~~ #### 配置部分 配置部分設置郵件視圖參數。支持以下配置參數: | 參數 | 描述 | | --- | --- | | **學科** | 郵件主題,必填。 | | **布局** | 該[郵件布局](https://octobercms.com/docs/services/mail#mail-layouts)代碼,可選的。默認值為`default`。 | ### [](https://octobercms.com/docs/services/mail#mail-templates)使用郵件模板 郵件模板駐留在數據庫中,可以通過*設置>郵件>郵件模板*在后端區域中創建。模板中指定的**代碼**是唯一標識符,創建后即無法更改。 發送這些電子郵件的過程是相同的。例如,如果使用代碼*this.is.my.email*創建模板,則可以使用以下PHP代碼發送該模板: ~~~ Mail::send('this.is.my.email', $data, function($message) use ($user) { [...] }); ~~~ > **注意:**如果系統中不存在郵件模板,則此代碼將嘗試查找具有相同代碼的郵件視圖。 #### 自動生成的模板 郵件模板也可以通過[已注冊的郵件視圖](https://octobercms.com/docs/services/mail#mail-template-registration)自動生成。該**代碼**值將與郵件視圖路徑相同(例如:author.plugin:mail.message)。如果郵件視圖定義了**布局**參數,則將使用該參數為模板提供布局。 首次保存生成的模板時,在為指定代碼發送郵件時將使用自定義內容。在這種情況下,郵件視圖可以視為*默認視圖*。 ### [](https://octobercms.com/docs/services/mail#mail-layouts)使用郵件布局 可以通過選擇*設置>郵件>郵件模板*,然后單擊*布局*選項卡來創建*郵件**布局*。它們的行為就像CMS布局,它們包含郵件的支架。郵件視圖和模板支持郵件布局的使用。 默認情況下,Oct具有兩種主要的郵件布局: | 布局 | 碼 | 描述 | | --- | --- | --- | | 默認 | 默認 | 用于面向公眾的前端郵件 | | 系統 | 系統 | 用于內部后端郵件 | ### [](https://octobercms.com/docs/services/mail#mail-template-registration)注冊郵件布局,模板和部分 可以將郵件視圖注冊為模板,這些模板將在后端自動生成以進行自定義。可以通過“*設置”>“郵件模板”*菜單自定義*郵件模板*。可以通過覆蓋[插件注冊類](https://octobercms.com/docs/plugin/registration#registration-file)的`registerMailTemplates`方法來注冊模板。[](https://octobercms.com/docs/plugin/registration#registration-file) ~~~ public function registerMailTemplates() { return [ 'rainlab.user::mail.activate', 'rainlab.user::mail.restore' ]; } ~~~ 該方法應返回一個[郵件視圖名稱](https://octobercms.com/docs/services/mail#mail-views)數組。 像模板一樣,可以通過覆蓋[Plugin注冊類](https://octobercms.com/docs/plugin/registration#registration-file)的`registerMailPartials`and`registerMailLayouts`方法來注冊郵件部分和布局。[](https://octobercms.com/docs/plugin/registration#registration-file) ~~~ public function registerMailPartials() { return [ 'tracking' => 'acme.blog::partials.tracking', 'promotion' => 'acme.blog::partials.promotion', ]; } public function registerMailLayouts() { return [ 'marketing' => 'acme.blog::layouts.marketing', 'notification' => 'acme.blog::layouts.notification', ]; } ~~~ 該方法應返回一個[郵件視圖名稱](https://octobercms.com/docs/services/mail#mail-views)數組。數組鍵將用作`code`部分或布局的屬性。 ### [](https://octobercms.com/docs/services/mail#mail-global-variables)全局變量 您可以使用該`View::share`方法注冊所有郵件模板全局可用的變量。 ~~~ View::share('site_name', 'OctoberCMS'); ~~~ 可以在[插件注冊文件](https://octobercms.com/docs/plugin/registration)的register或boot方法內部調用此代碼。使用上面的示例,該變量`{{ site_name }}`將在所有郵件模板中可用。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看