Liberal Leader Justin Trudeau’s now-former campaign co-chair has been advising TransCanada since last spring, a company spokesman has confirmed.

What’s more, Dan Gagnier, who stepped down from the Liberal campaign on Wednesday, says the party knew about the work.

The Canadian Press reported that Gagnier sent a detailed memo to energy company TransCanada earlier this week, advising officials there how to deal with a new government following Monday’s election. Trudeau told reporters on Thursday that that was inappropriate.

Gagnier worked as a contractor and primarily offered communications advice regarding the Energy East pipeline, TransCanada spokesman James Millar wrote in an email to Maclean’s. The pipeline proposal is controversial in Quebec, the province in which Gagnier once worked as an adviser to former premier Jean Charest. If built, the 4,600-km pipeline would send about 1.1 million barrels of crude oil per day from Alberta and Saskatchewan to refineries and port terminals in eastern Canada, TransCanada says on its website.

“[Gagnier’s] counsel has been helpful in guiding us on how best to communicate the benefits of the project to Canadians,” Millar said.

He wouldn’t say who received Gagnier’s email—the recipients’ names are blanked out of the nearly three-page memo—but they all had TransCanada email addresses. Millar said he doesn’t know who leaked the email, but confirmed the company is investigating, since an internal email was distributed outside the company.

The memo from Gagnier to TransCanada detailed what a new government would have to take care of in its first days in office, including senior appointments to the Prime Minister’s Office and who would be in cabinet. It also listed possible implications for TransCanada and Energy East.

In a brief email to Maclean’s, Gagnier said he told the Liberals about his work for TransCanada and that there was an understanding he wouldn’t contribute to discussions on energy policy.

A spokeswoman for the party said it’s public knowledge that Gagnier was advising TransCanada, pointing to an article by La Presse last February that noted he was in talks with the company.

“[Gangier] informed the Liberal campaign that he was advising his client, TransCanada, on issues related to the provincial Quebec government. When it became clear that he was advising his client on federal transition issues, we took the steps that we did,” Kate Purchase wrote in an email.

The party also referred Maclean’s to Trudeau’s comments from Thursday morning.

“We demonstrated, within 24 hours of finding out about this letter, the level of high standards of ethics and accountability that I have always expected of everyone around me,” Trudeau said.

Gagnier has always acted in a responsible way over his long career working in various governments, Trudeau added, but “acted in an inappropriate way a few days ago and, when we found out about it, we sat down with him and he chose to do the responsible thing and step down from our campaign.”

The spokesman did not respond when asked what changed Trudeau’s mind about the work Gagnier was doing.

As campaign co-chair, Gagnier was in the war room periodically and was a go-to voice on Quebec strategy for Trudeau and his team.

This isn’t the first time Gagnier’s name has come up in connection to allegedly inappropriate lobbying.

In 2013, the RCMP filed court documents seeking the bank records of Bruce Carson, a former adviser to Prime Minister Stephen Harper. According to the RCMP, Carson was lobbying illegally for the Energy Policy Institute of Canada (EPIC), an organization he helped to create and worked with from 2009 to 2011. Gagnier was vice-chair of EPIC at the time Carson was working with the organization. He’s also one of the people the RCMP says knew that Carson may have been lobbying while prohibited from doing so.

In the documents, known as an ITO, or information to obtain a production order, the RCMP says members of EPIC’s executive committee, which included Gagnier, “were aware of Mr. Carson’s communication with [holders of public office] in order to promote EPIC,” contrary to the Lobbying Act. The work included setting up meetings and briefings with government officials, including Harper’s then-chief of staff Nigel Wright.

As a former PMO staffer, Carson fell under rules brought in by the Conservatives that banned public office holders from lobbying for five years after leaving government. That blocked Carson from lobbying until February 2014. EPIC was started by the energy industry as a non-partisan policy advocacy organization, with Carson beginning his work there in August 2009.

Gagnier and Carson weren’t the only two active with EPIC to have political ties: Former trade minister David Emerson, who sat as both a Liberal and a Conservative MP, took over as chair of EPIC late in 2009; Doug Black, a Conservative-appointed senator who sat on the upper chamber’s energy and environment committee, served as EPIC’s president; and Frank McKenna, the deputy chair of TD Bank and a former Liberal premier, was one of EPIC’s vice-chairs. McKenna is also on Trudeau’s economic council of advisers. Gagnier is listed as EPIC’s president in a year-old news release on its website (the most recent news release posted; there is no staff directory or board of directors listed).

Gagnier has been active in the energy and sustainable development industries. He’s also a past chair of the International Institute on Sustainable Development, a registered charity in Canada whose president is former Canadian environment commissioner Scott Vaughan.

