瀏覽代碼

Documented CORS

Brendan Abolivier 8 年之前
父節點
當前提交
f7793837e6
簽署人: Brendan Abolivier <contact@brendanabolivier.com> GPG 金鑰 ID: 8EF1500759F70623
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      README.md

+ 4
- 1
README.md 查看文件

77
     "recipients": [
77
     "recipients": [
78
         "you@example.tld",
78
         "you@example.tld",
79
         "someone.else@example.com"
79
         "someone.else@example.com"
80
-    ]
80
+    ],
81
+    "formOrigin": "https://example.tld"
81
 }
82
 }
82
 ```
83
 ```
83
 
84
 
85
 
86
 
86
 The `recipients` server is an array containing the e-mail addresses any message sent via the form will be sent to. Just write down the form's recipient(s)'s addresse(s).
87
 The `recipients` server is an array containing the e-mail addresses any message sent via the form will be sent to. Just write down the form's recipient(s)'s addresse(s).
87
 
88
 
89
+Finally, the `formOrigin` part is a string containing the origin of the page you'll include the contact form into. This allows SMAM to work with the [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) security most browser use. For more info on how to fill this field, and what is an origin, please give a look at [the MDN's definition](https://developer.mozilla.org/en-US/docs/Glossary/origin).
90
+
88
 ## Templating
91
 ## Templating
89
 
92
 
90
 Each e-mail sent by the form follows a template described in `template.pug` (it's [Pug](pugjs.org/)). If you want to change the way the e-mails you receive are displayed in your mailbox, just edit it! You don't even need to restart the server aftewards :smile:
93
 Each e-mail sent by the form follows a template described in `template.pug` (it's [Pug](pugjs.org/)). If you want to change the way the e-mails you receive are displayed in your mailbox, just edit it! You don't even need to restart the server aftewards :smile: