Browse Source

Merge pull request #3 from babolivier/development

Documented CORS
Brendan Abolivier 8 years ago
parent
commit
1b90dd68e5
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      README.md

+ 4
- 1
README.md View File

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: