When's the best time to advertise electric cars? The middle of a gas shortage.

Strikes have brought parts of France's oil industry to a standstill this week. Gas stations are running dry, lines are building at the pumps and people are hoarding fuel. The only people smiling? Electric car owners.

And electric car makers have been quick to seize the golden marketing opportunity.

France's Renault (RNLSY) launched a campaign this week to boost the visibility of its top selling electric car, Zoe, with multiple posts on Facebook (FB) and Twitter (TWTR) and advertisements in three French newspapers.

"In France, we don't have any more petrol but we do have Zoe," tweeted Renault. Its Facebook posts quickly received thousands of 'likes' and 'shares'.

Renault said the campaign had led to a 50% spike in calls from drivers seeking information about the Zoe model. It also prompted electric car owners to post carpooling offers online to help other drivers who had run out of fuel.

"The viral effect was a real success," a Renault spokesperson told CNNMoney.

Renault wasn't alone. Citroën, Kia and Volvo also posted images on social media to promote their electric and hybrid vehicles.

A Citroën post on Twitter showed vehicles with the same colors as the nation's flag that said in French: "Fed up with queuing? Here's a solution."

Related: 1 in 3 gas stations in France is running dry

The strikes were called late last week to protest new labor laws imposed by the French government that make it easier for employers to fire workers and reduce overtime pay.

Employees from oil refineries, nuclear power plants and some public transportation networks have gone on strike. Several oil refineries were forced to halt operations, contributing to the gas shortage.

The government bypassed the French parliament earlier this month and ordered the adoption of the new legislation because it feared the measures would be defeated by lawmakers.

It says the labor market reforms are needed to make France a more attractive place for employers to do business, and boost economic growth.

Labor unions are demanding the government withdraws the changes, and are threatening even more disruption.

Related: Germany's 1.4 billion boost for electric cars

As strikes are expected to continue through the coming weeks, there's no doubt that electric and hybrid car makers are hoping to grow their sales. France is the second largest European market for electric cars, after the U.K., according to sales data from market intelligence firm LMC Automotive.

Nearly 65,000 hybrid and electric cars were sold in France last year, which is just over 3% of total sales.

--CNN's Anaïs Furtade and Armelle De Oliveira in Paris contributed to this report.