strapi/docs/.vuepress/dist/assets/js/11.bfb9de0f.js

1 line
18 KiB
JavaScript
Raw Normal View History

2018-10-05 17:24:17 +02:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{228:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("Strapi contains a set of tools to send emails. This part is based on the\nfamous email node module: "),a("a",{attrs:{href:"http://nodemailer.com",target:"_blank",rel:"noopener noreferrer"}},[t._v("Nodemailer"),a("OutboundLink")],1),t._v(".")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),a("p",[t._v("Options:")]),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),a("p",[t._v("The email service allows you to easily send emails from anywhere in your application.")]),t._v(" "),a("p",[t._v("Usage as a promise (yieldable) :")]),t._v(" "),t._m(6),a("p",[t._v("Usage with a callback :")]),t._v(" "),t._m(7),t._m(8),t._v(" "),a("p",[t._v("The email API is a simple API which can be used from your client (front-end, mobile...) application.")]),t._v(" "),a("p",[t._v("Route used to send emails:")]),t._v(" "),t._m(9),a("p",[t._v("Request payload:")]),t._v(" "),t._m(10),a("p",[t._v("Response payload:")]),t._v(" "),t._m(11),t._m(12),t._v(" "),a("p",[t._v("Each sent email is registered in the database. So you can retrieve them whenever\nyou want. However, you can disable this option by overriding the email service logic.")])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"email"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#email","aria-hidden":"true"}},[this._v("#")]),this._v(" Email")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"email-config"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#email-config","aria-hidden":"true"}},[this._v("#")]),this._v(" Email config")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("To change the STMP config, edit the "),s("code",[this._v("./api/email/config/environments/development/smtp.json")]),this._v(" file.")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token string"}},[t._v('"smtp"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token string"}},[t._v('"from"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"test<no-reply@test.com>"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token string"}},[t._v('"service"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token string"}},[t._v('"name"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('""')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token string"}},[t._v('"user"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('""')]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token string"}},[t._v('"pass"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('""')]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("code",[t._v("from")]),t._v(" (string): The email address used to send emails.")]),t._v(" "),a("li",[a("code",[t._v("service")]),t._v