Skip to content
Florian Stober edited this page May 23, 2019 · 5 revisions

On this page different configuration options of the plugin are explained.

General

mail_command: mail

The mail_command option can be used to change the command. E.g. if you change this to gmail then players have to type /gmail ... to send and/ or read mails.

showMailsOnLogin: true

The showMailsOnLogin determines which message is shown to players on login.

showMailsOnLogin: false showMailsOnLogin: true
Note that players don't get a message if they don't have any new mail.
showMailsOnServerSwitch: true

If showMailsOnServerSwitch is set to true whenever they switch servers, players will see the same message as on login.

enable_tab_complete: true

The enable_tab_complete is used to configure whether tab completion of player names in the mail command is enabled. You might want to disable this on large servers.

Storage

useMySQL: false

If useMySQL is set to true mails are stored in a mysql database. Otherwise the plugin uses a json file.

If MySQL storage is used you need to provide te following connection information:

mysql_hostname: localhost
mysql_port: 3306
mysql_database: minecraft
mysql_username: root
mysql_password: superSecretPassword

The plugin can automatically delete old mails. If cleanup_enabled is set to true the plugin will periodically delete all mails older than cleanup_threshold days. Unread mails will never be deleted.

cleanup_enabled: true
cleanup_threshold: 7

Messages

Almost all messages can be customized. Have a look at Text Format for different formatting options.

Login

loginNewMails: "&aYou have %num% new mails. Type [i][command]/mail view[/command][/i] to read them."

The loginNewMails message is sent to player when they join the server. Use the %num% placeholder to obtain the number of new mails.

Reading Mail

noMessages: "&eYou don't have any messages"
noNewMessages: "&eYou don't have any new messages"

When using /mail listall and there are no messages, noMessages is used. When using /mail list and there are no messages, noNewMessages is used.

listallHeader: "&9[==== Showing %start% to %end% of %max% mails === [command=/mail listall %next%]next[/command] ====]"
listHeader: "&9[==== Showing %visible% of %max% messages. [command=/mail list]more[/command] ====]"
listallFooter: ""
listFooter: ""
oldMessage: "&7From %sender%: &f%message%    &o&6[suggest=/mail del %id%]delete[/suggest]"
newMessage: "&6From %sender%: &f%message%    &o&6[suggest=/mail %sender%]reply[/suggest]"

When using /mail listall, listallHeader is sent first followed by some messages and then listallFooter. For each message either oldMessage or newMessage is used, depending on whether the message has already been read. If listallFooter is not set or empty it is not sent.

The /mail list command works similar, here listHeader and listFooter are used.

The following placeholders can be used in listallHeader, listHeader, listallFooter and listFooter:

Placeholder Description
%start% First mail displayed.
%end% Last mail displayed.
%max% Total number of mails.
%list% Either list or listall depending on which has been used by the player.
%next% Next mail to display. This is %end% + 1.
%visible% Number of mail displayed.

In oldMessage and newMessage the following placeholders can be used:

Placeholder Description
%sender% Name of the sender.
%time% Time when the mail has been sent. Using hh:mm:ss format.
%time_<format>% Time when the mail has been sent. The format is configurable. See https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html for documentation of the format. Example: %time_d. MMM, h:mm a% leads to 20. May, 11:01 PM.
%time_<format>_<timezone>% Time when the mail has been sent. The format and time zone are configurable. The time zone can be full name like America/Los_Angeles or a custom id like GMT+8.
%id% Internal id if the mail. Useful for commands.
%message% Content of the mail.

Sending Mail

messageSent: "&aYour mail has been sent successfully."
messageSentToAll: "&aYou just sent %num% mails."
receivedNewMessage: "&cYou just received a new mail. Type [command]/mail list[/command] to see it."

messageSent is used to confirm success of the /mail send command. Use %receiver% to insert the recipient name and %message% to insert the message sent.

messageSentToAll is used to confirm success of the /mail sendall command. Use %num% to refer to the number of mails sent.

receivedNewMessage is sent to a player when he receives a message while online.

Deleting Mail

deletedSingle: "&aYou deleted 1 message."
deletedRead: "&aYou deleted all old mails."
deletedAll: "&aYou deleted all mails."

Help Message

Let your players know how to use the plugin.

help: |-
  &b[suggest]/mail help[/suggest] &eshows this cool help page
  &b[suggest]/mail list[/suggest] &eshows new mails
  &b[suggest]/mail listall[/suggest] &eshows all mails (also ones that you have already read)
  &b[suggest=/mail ]/mail <player> <message>[/suggest] &esend a mail
  &b[suggest=/mail sendall ]/mail sendall <message>[/suggest] &esend [b]many[/b] mails :D
  &b[suggest=/mail del ]/mail del all|read|#[/suggest] &edelete mails

Error Messages

wrongSyntax:
  del: "&cWrong syntax! Use &b[suggest=/mail del ]/mail del <all|read|#>[/suggest]"
  list: "&cWrong syntax! Use &b[suggest=/mail list ]/mail list <page>[/suggest]"
  listall: "&cWrong syntax! Use &b[suggest=/mail listall ]/mail listall <page>[/suggest]"
  send: "&cWrong syntax! Use &b[suggest=/mail send ]/mail send <player> <message>[/suggest]"
noPermission: "&cYou. Don't. Have. Permission."
commandError: "&cAn error occurred while processing your command: %error%"
emptyMail: "&cYou can't send empty mails."
unknownTarget: "&cUnknown target: You may only send mails to players which have played on the server before."

Clone this wiki locally