Console¶
Zammad uses Ruby on Rails so you can make use of the Rails console.
Warning
Please double check your commands before running, as some of those commands might cause data loss or damaged tickets! If you’re unsure, use a test system first!
To open the Rails console on the shell you have to enter the following commands.
Start Zammad’s Rails Console¶
Running a Single Command¶
The following command will allow you to run a single command, without running a shell (e.g. for automation).
Note
Replace {COMMAND} with your command you want to run.
Tip
If you enter a p in front of your command
(e.g. like rails r 'p Delayed::Job.count'),
you’ll actually receive a printed output (without you won’t!).
$ docker compose run --rm zammad-railsserver bundle exec rails r '{COMMAND}'
$ zammad run rails r '{COMMAND}'
$ rails r '{COMMAND}'
Running Several Commands in a Shell¶
The following command will provide you a Rails console. It allows you to run several commands inside it.
$ docker compose run --rm zammad-railsserver bundle exec rails c
Tip
If you use Portainer to manage your Docker containers, you can even use a console via Portainer’s GUI.
$ zammad run rails c
$ rails c
Hint
Starting Rails Console in Safe Mode
Normally, starting a Rails console requires certain third party services to be up and running. You may receive errors and console will refuse to start in case they are not available.
However, it’s possible to start Rails console in safe mode by setting
the environment variable ZAMMAD_SAFE_MODE=1. With this setting enabled,
the availability of these services will be ignored.
Set variable and run Rails console:
$ ZAMMAD_SAFE_MODE=1 zammad run rails c
$ ZAMMAD_SAFE_MODE=1 rails c
This gives you a response like this:
Working on the console¶
Here’s a topic list for quick jumping and better overview.
- Query and Set / Update Zammad Settings
- Advanced Customization Settings
- Send All Outgoing Emails to a BCC-Mailbox
- Activate Counter on Grouped Overviews
- Default Ticket Type on Creation
- Show a Note During Article Creation
- Show Email Address of Customer on Customer Selection (Ticket Creation)
- Change Font Settings for Outgoing HTML Emails
- Highlight Customer’s Open Ticket Count
- Activate Attachment Tab in Sidebar
- Time Period for Showing Customer Profile on New Calls
- Working on User Information
- Working with Ticket Information
- Working with Ticket Articles
- Working with Groups
- Working with Chat Logs
- Other Useful Commands
- Deleting Records