mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-18 12:16:41 -04:00
use canonical_name if it is available; report error when trying to send mail to non-existent players
This commit is contained in:
parent
43bf5b9a6f
commit
f7a7ef361a
5 changed files with 83 additions and 72 deletions
6
api.md
6
api.md
|
@ -35,12 +35,13 @@ mail = {
|
|||
## Sending mail
|
||||
Old variant (pre-1.1)
|
||||
```lua
|
||||
mail.send("source name", "destination name", "subject line", "mail body")
|
||||
local error = mail.send("source name", "destination name", "subject line", "mail body")
|
||||
-- error will contain an error message if mail couldn't be delivered, otherwise nil
|
||||
```
|
||||
|
||||
New variant (1.1+)
|
||||
```lua
|
||||
mail.send({
|
||||
local error = mail.send({
|
||||
from = "sender name",
|
||||
to = "destination name",
|
||||
cc = "carbon copy",
|
||||
|
@ -48,6 +49,7 @@ mail.send({
|
|||
subject = "subject line",
|
||||
body = "mail body"
|
||||
})
|
||||
-- error will contain an error message if mail couldn't be delivered, otherwise nil
|
||||
```
|
||||
|
||||
# Hooks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue