PHP passing messages back to Ajax
There are a few things that you might consider here, to improve readability, maintainability, and (indirectly through those qualities), reliability.

As a guideline, if a piece of code goes over 10 lines or statements, it is probably about time to break it up into functions.

In this case, I might consider breaking it up into following functions:

public function getEmailInput() {}
public function getFileInput() {}
public function insertIntoDatabase() {}
public function generatePdf() {}
public function sendConfirmationEmail() {}
//Maybe some others, as you see fit


This will allow give you a little more freedom to update the steps as that inevitably becomes necessary without as much risk of breaking other parts or having to remember how the entire program works.

On the JavaScript side, it looks like this is the kind of script that needs to fail safe, so I might consider checking for success rather than failure, like so:

.done(function (response) {
    if(response === 'success'){ //make sure we got the response we needed
        window.location.replace('failure.html');
    } else {
        window.location.replace('success.html');
    }
}).fail(function (jqXHR, textStatus) {
    console.log(textStatus);
});