The speechwriter who helped President Barack Obama pen his stirring address memorializing the victims of the Charleston church massacre will release a memoir about his time working in the White House.

Sugar23 Books, an imprint of Houghton Mifflin Harcourt Books & Media, has acquired “Grace: A President, His Speechwriter, and Ten Days in the Battle for America” by Cody Keenan, one of the 44th president’s chief wordsmiths. The title is a reference to Obama’s eulogy for the victims of that mass shoot. He closed his remarks at Emanuel African Methodist Episcopal Church by leading a chorus of “Amazing Grace.”

“Grace” will be released in 2022. Keenan’s book will focus on 10 days in Obama’s presidency, during which he helped write addresses for the president dealing with everything from a public debate on the Confederate flag to Supreme Court rulings on healthcare and gay marriage. The publisher says the book will chronicle “a whirlwind of dramatic moments too implausible for a full season of ‘The West Wing.'”

“’Grace’ started with a string of tweets on the second anniversary of that week,” Keenan said. “At first, all I wanted to do was tell a story to show what this country can be at its best and what writing with Barack Obama is actually like when the stakes are highest. The years since have only added context to how those 10 days help make sense of the broader sweep of American progress and backlash, this clash of two fundamentally opposing visions of America — and this feels like the right time to finally sit down and write it all up.”

Keenan worked with Obama since 2007, rising from a campaign intern in Chicago to his chief speechwriter at the White House. He continued to work with Obama after his presidency concluded. Sugar23 is a media company launched by veteran manager and producer Michael Sugar. The company founder’s many credits include “Spotlight” and “The Knick.”

“’Grace’ offers an extraordinary glimpse into the mind of President Obama, and it introduces another prolific American thinker to the world, Cody himself,” said Sugar. “To be in proximity to Cody and to help publish ‘Grace’ is one of the true honors of my life to date.”