If you asked public relations people around the world which CEO they would most like to work for, my guess is that the names of Pepsi’s Indra Nooyi and United Airlines’ Oscar Munoz would come up quite often (behind only Unilever’s Paul Polman). So it is interesting—and a little disappointing—to see Pepsi and United making headlines for all the wrong reasons in recent weeks.

Nooyi has earned widespread plaudits from corporate social responsibility advocates for her espousal of “capitalism with a purpose” (though shareholders have not always been as impressed) and her emphasis on expanding her company’s portfolio of “good for you” brands. She has also spoken eloquently about the challenges facing women executives who want to balance work and family life.

Munoz, meanwhile, came into an airline best known for breaking guitars, though there were plenty more substantial concerns about United’s performance: predecessor had resigned amid a corruption investigation, and its workers were “divided and disgruntled.” He embarked on a “listening tour” designed to understand the reputation challenges the company faced, and used the information he gathered to quickly redefine United’s vision and purpose.

Both Nooyi and Munoz appear to understand how societal expectations have changed, how stakeholder relationships are defined by actions rather than words, and how vital the role of communications is to success in today’s complex world. Both Pepsi and United are in line for SABRE Awards this year (the former for its “Performance with Purpose” reputation management initiative, the latter for CEO of the Year.

So what are we to make of the crises—both entirely self-inflicted—that have hit these two companies in recent weeks?

First, United found itself at the center of a social media firestorm after two teenage girls were told they could not board a United flight wearing leggings. It quickly became clear that the girls who were asked to change were traveling on passes provided to family or friends of United employees, and that rules covering such “pass-riders” prohibit “form-fitting lycra/spandex tops, pants and dresses.”

(Another girl, who was not aware that those rules applied only to pass-riders, elected to change out of her own leggings after witnessing the incident.)

The initial response, both from the “only following the rules” gate agent and the company’s customer service department, was tone-deaf at best. Writing at Inc., marketing expert Chris Matyszczyk makes a convincing case that United’s policy, and the way it was enforced, showed a distinct lack of emotional intelligence.

“Even if the customer is wrong, even if it's on Twitter, and even if that customer wasn't directly associated with the incident, don't come off as a hard-nosed attorney general…. United could have shown concern. It didn't. What did it gain? Nothing. What did it lose? The emotional support of hundreds and thousands of bystanders who also happen to occasionally fly the airline…. The icy tone of United's tweets was just asking for trouble.”

Actor and comedian Seth Rogan’s Twitter response to United’s insistence on doubling down on a bad policy captured the wrong-headedness perfectly: “We here at @united are just trying to police the attire of the daughters of our employees! That's all! Cool, right?”

As for Pepsi, the company found itself in hot water after producing a television commercial featuring model Kendall Jenner offering a can of the company’s eponymous soda to a policeman during a protest/street party (no description can do the ad justice, although this from the UK’s Independent newspaper comes close).

The ad was clearly designed to provoke a response, and it did: half of those who saw it were outraged; the others were merely baffled.

“The Internet backlash proved that advertisers cannot simply appropriate political movements or moments without having a more nuanced understanding of them,” wrote ad critic Barbara Lippert at CNN. “But in this case, the obvious pandering to millennials, many of whom are genuine activists and search out brands that are socially conscious, royally backfired.”

The social media response was predictably hilarious and scathing.

Still, at least Pepsi has the good grace to acknowledge that it screwed up. “Pepsi was trying to project a global message of unity, peace and understanding," the soft-drink-maker said. "Clearly we missed the mark, and we apologize. We did not intend to make light of any serious issue. We are removing the content and halting any further rollout."

As I noted earlier, Pepsi and United are both admirable companies, with good values, led by CEOs who typically exhibit empathy and emotional intelligence.

And both have excellent public relations teams. Pepsi’s executive VP of communications Jon Banner and United’s senior VP of corporate communications Jim Olson are both top professionals who have clearly played a critical role in their companies’ recent success.

Now, a quick disclaimer: I have no idea how involved Banner or Olson were in the decisions surrounding these recent crises or their feelings about how they were handled. So the points that follow are intended to be general suggestions about best practices rather than specific criticisms of how PR people were or were not consulted in these instances.

First, public relations people are the ones ultimately responsible for a company’s reputation, and the relationship between a company and its stakeholders. As such, they should be involved in all decisions that have the potential to impact reputation or stakeholder relationships.

Second, few things have as much potential to impact reputation or stakeholder relationships as poor customer service or an insensitive ad campaign. Therefore, public relations people should be involved in all customer service policy-making and new ad campaign ideas.

(I get push-back on this all the time: “Can PR really be expected to check every decision that has the potential to harm our reputation?” To which I say, “Are a company’s lawyers expected to make sure that all ad campaigns and customer service policies are legal?” Are reputation risks really less serious in this day and age than litigation risks?)

So yes, public relations people should take a look at every ad campaign, if only to provide a view from outside the creative bubble. As the PR Council put it in a statement this weekend: “PR professionals are often criticized for getting in front of a Creative’s ‘bold’ ideas, but sometimes helping a client avoid a disaster can be an invaluable contribution. All ads and storytelling should be thoroughly vetted; asking and answering the scenarios that may play out when taking a risk, should a crisis arise.”

Similarly, public relations people should be involved in the way service policies are enacted and enforced. I have a personal preference for a values-drive approach to customer service and other outward-facing policies, rather than the rules-based approach that seems to dominate. If a company understand its values, and communicates them effectively throughout the organization, most employees are capable of understanding the right thing to do in a particular situation without consulting a rulebook.

Again, I have no way of knowing whether these specific crises could have been avoided, but I do know that many companies could crisis-proof themselves by making sure public relations professionals are more broadly involved in the decision-making process—around customer services, marketing strategy, and hundreds of other issues too.

UPDATE: The day we published this article, United's customer service policy one-upped itself with an even more egregious incident, this time forcibly removing a passenger after he refused to voluntarily give up his seat to United employees. These incidents have the potential to undo all the great reputation restoration work done by Munoz, Olson and others over the past couple of years. It's insane that PR does not have oversight responsibility for these policies.