In case of a terrorist attack, a chemical fire, or even a street closing, the city now has the capability of alerting people wherever they are.

The city unveiled a new alert system Thursday, one that uses phone calls, text messages and emails to notify residents and people who work in the city about emergencies and non-emergencies.

Code Red, a system the city purchased for $307,400, has the capability to notify all registered residents and businesses, or just a few people on an affected block, to be aware of hazardous conditions.

Mayor Byron W. Brown, who unveiled the technology in a news conference in his office, noted that the system was also used by the City of Boston during the marathon bombings.

“We saw how quickly that system worked,” Brown said.

The city can send an alert to a single person, or to everyone in the registry, depending on the severity of the situation.

The mayor or other top city officials will decide when the alerts will be used, said Fire Commissioner Garnell W. Whitfield Jr.

Listed land line telephone numbers already have been added to the system. People who wish to register their cellphone number, email address or unlisted land line number can sign up on the city’s website,, or by calling 311. Fire houses also have applications, and the Fire Department will have applications available at community events, including the Italian Heritage Festival this weekend.

“These types of emergency notification systems are only as good as the telephone number database supporting them,” Whitfield said. He warned people not to assume their number is already in the database.

People will know if they are in the database when a test alert is issued at 3 p.m. next Thursday.

Travelers to parts of the country that also use Code Red can get emergency alerts on their smartphones in those cities.

The Code Red application, available through iTunes or Google Play, uses the phone’s geolocation service to send alerts to travelers passing through areas with emergency situations.

In Buffalo, the system was paid for with a federal grant and will cost $1,200 yearly to maintain.

Town officials in Hamburg rolled out their Code Red system in June, and Lancaster, Elma, Depew and Marilla also use the technology.