The feel-good drama, released on the streaming service on Dec. 7 and based on a 2015 young adult novel, tells the story of 17-year-old Willowdean (played by PATTI CAKE$ breakout star Danielle Macdonald).

She's a big girl in a small Texas town where her mother Rosie (Jennifer Aniston) is a former pageant queen and something of a local celebrity. At the story's opening, Willowdean is mourning the death of her beloved aunt, who taught her confidence in the face of body-shaming bullies and also instilled a love of country music legend Dolly Parton. Willowdean and her best friend Ellen (Odeya Rush) rely on Parton's uplifting songs and pithy life advice to get them through most of their teenage angst, including when they decide to join Rosie's pageant as an act of protest against their town's superficial and conservative values. The girls, joined by fellow misfits Millie (Maddie Baillio) and Hannah (Bex Taylor-Klaus), get some beauty-pageant help along the way from Dolly drag queens, all while delighting in the songstress' music.

It makes sense, then, for the film's storyline to be tightly wound with Parton's iconic songs. But Dumplin' is an indie film with a limited budget. How did they secure some of country's most legendary music?

To explain that, you first have to look at Dolly Parton's career. The 72-year-old singer was savvy enough from a very young age to recognize the value of her own songwriting, and viewed her songs as not only art, but products. In 1968 when she was just in her twenties, Parton and her uncle, Bill Owens, formed Owe-Par Publishing Company. This means she retained a controlling interest in all her songs from the start.

Parton famously turned down Elvis Presley when he asked to record her hit, "I Will Always Love You," and demanded 50 percent of the publishing rights and royalties. The decision has obviously paid off very well for her -- literally.

During pre-production, the Dumplin' team secured Aniston as a star and producer, but the project was still an indie film. They decided they could go for the big ask and pursue at least a little of Parton's music, because they viewed it as integral to the film. Knowing they probably couldn't afford the rights, they approached Parton's manager. Screenwriter Kristin Hahn told Pop Sugar about the process.

"He took the time to read the script, walked it into her house, and said, 'I think you need to look at this,'" Hahn said. "And she looked at the title, and then walked over to her bookshelf and took a copy of Dumplin' off her shelf, and said 'I already know all about this!'"

Hahn said it wasn't just that the original book was essentially about Parton. The story and characters resonated with her immediately.

"She really responded to the message of the movie, about women defining the meaning of beauty for themselves, and giving themselves permission," Hahn said.

Because Parton owns her own music catalogue, she was able to give the production easy access. On top of that, she partnered with composer Linda Perry and wrote five new songs for the film. And one of those new songs, "Girl in the Movies," was just nominated for a Golden Globe.

There are a lot of things that helped Dumplin' get Dolly Parton onboard. Having the pedigree of a popular YA novel as intellectual property doesn't hurt. Aniston joining as a star and producer (via her banner Echo Films) helps a lot too. But if Parton had read the script and hated it, there's probably no way her music would have been involved.

Similarly, if you've ever seen Hal Ashby's Harold and Maude, it's probably hard for you to divorce the storyline from the movie's iconic soundtrack by Yusuf Islam (formerly Cat Stevens). He wrote so many good songs for the film, and they fit the time period and slightly offbeat plot perfectly. 

In this film's case, Islam had never met quirky director Ashby. However, he connected with the story and characters enough to want to work on the film.

As Cameron Crowe points out in this video, and as Islam confirms, his initial connection to the project was with the darker side of main character, Harold. Once again, the strength of the original material was enough to attract legendary talent.

Another film that features music integral to its identity is The Graduate, but this soundtrack was more the result of a happy accident. Director Mike Nichols and producer Lawrence Turman wanted Paul Simon and Art Garfunkel’s music, but they weren't overly enthusiastic, and even though Simon was hired to write three new songs, he was too busy touring and just never finished. The production used some of Simon and Garfunkel's old songs as temporary tracks (and an unfinished version of "Mrs. Robinson"), and they survived the final cut of the film.

This wasn't so much an instance of artists connecting on a deep level to the story, but the production itself being persistent, getting innovative, and bringing new life to already-released songs.

From Dumplin' and Harold and Maude at least, we can learn that one of the best ways to secure a known artist's music is to start with strong material. Be familiar with the songwriters, know what they will connect to on an emotional level, and don't be afraid to ask them for exactly what you want. And if it doesn't work out -- heck, try some temp tracks, and maybe your film will end up stronger in the long run!